Skip to content

Commit

Permalink
fix payload message notification
Browse files Browse the repository at this point in the history
  • Loading branch information
Danielzxccc committed May 2, 2024
1 parent 9df6448 commit 0f0a3be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/modules/Forums/ForumsInteractor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export async function createNewQuestion(
const newQuestion = await Service.createQuestion(content, tags)

if (newQuestion.private) {
emitNotificationToFarmHeads()
emitNotificationToFarmHeads(userid)
}

await uploadFiles(uploadedFiles)
Expand Down
7 changes: 5 additions & 2 deletions src/modules/Socket/SocketController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export function emitNotificationToAdmin(payload: string) {
io.emit('admin', payload)
}

export function emitNotificationToFarmHeads() {
io.emit('farm_head', 'CHAT_EVENT_TRIGGER')
export function emitNotificationToFarmHeads(userid: string) {
io.emit('farm_head', {
userid,
event: 'CHAT_EVENT_TRIGGER',
})
}

0 comments on commit 0f0a3be

Please sign in to comment.