From 3f43f3d801ba6c0f493a65801735833b075647a3 Mon Sep 17 00:00:00 2001 From: Namekuji Date: Tue, 22 Aug 2023 09:25:17 -0400 Subject: [PATCH] fix: thread muting --- .../endpoints/notes/thread-muting/create.ts | 25 +++++++++++-------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts b/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts index e4803cc291..c9dfd1321d 100644 --- a/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts +++ b/packages/backend/src/server/api/endpoints/notes/thread-muting/create.ts @@ -4,6 +4,7 @@ import readNote from "@/services/note/read.js"; import define from "../../../define.js"; import { getNote } from "../../../common/getters.js"; import { ApiError } from "../../../error.js"; +import { scyllaClient } from "@/db/scylla.js"; export const meta = { tags: ["notes"], @@ -36,18 +37,20 @@ export default define(meta, paramDef, async (ps, user) => { throw err; }); - const mutedNotes = await Notes.find({ - where: [ - { - id: note.threadId || note.id, - }, - { - threadId: note.threadId || note.id, - }, - ], - }); + if (!scyllaClient) { + const mutedNotes = await Notes.find({ + where: [ + { + id: note.threadId || note.id, + }, + { + threadId: note.threadId || note.id, + }, + ], + }); - await readNote(user.id, mutedNotes); + await readNote(user.id, mutedNotes); + } await NoteThreadMutings.insert({ id: genId(),