Skip to content
Snippets Groups Projects
Commit 7ad7904d authored by GOEPP THOMAS's avatar GOEPP THOMAS
Browse files

refactor: playing quiz with SSE

parent 60f1bda0
Branches
1 merge request!136Feature/138 refacto plaing quiz sse
......@@ -43,7 +43,7 @@ export default function Lobby({navigation, route}: Props) {
const [showModal, setShowModal] = useState<boolean>(false);
const [esUseState, setEsUseState] = useState<EventSource<CustomEventType>>();
const {createParty, generateRun, startParty} = useMultiService();
const {createParty, generateRun, startParty, nextQuestion} = useMultiService();
const userInvite = { id: 0, username: 'Invite', email: 'invite@email.com'}
let goodId = roomId;
......@@ -135,7 +135,10 @@ export default function Lobby({navigation, route}: Props) {
};
const onPlayPressed = async () => {
await startParty();
console.log("playing es :" + esUseState);
navigation.navigate("PlayingQuizMultiMode", {runId: runId, socket: esUseState, roomId: roomId});
startParty();
};
const onCancelPressed = () => {
......
......@@ -55,7 +55,6 @@ export default function PlayingQuizMultiMode({route, navigation}:Props) {
setQuizState(QuizState.ANSWERING);
});
}
const fetchRuns = async () => {
if (runId === undefined) return;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment