Skip to content

Commit f311434

Browse files
authored
fix: storage updates in websockets (#18)
1 parent 9aae7a1 commit f311434

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

server/utils/storage.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,10 @@ export async function publishQuestion(questionId: string): Promise<Question | un
217217

218218
// Clear all answers when publishing new question
219219
await fs.writeFile(ANSWERS_FILE, JSON.stringify([]))
220+
221+
// Broadcast the new question as a results update
222+
const results = await getResultsForQuestion(question.id)
223+
broadcast('results-update', results)
220224
}
221225
return question
222226
}

0 commit comments

Comments
 (0)