From 1abd1b3d190fe6710cd63fff74eff84dc5c1fb3e Mon Sep 17 00:00:00 2001 From: Diego Mello Date: Thu, 14 Nov 2024 17:26:01 -0300 Subject: [PATCH] regression: wrong usage of db batch (#5997) --- app/lib/methods/getCustomEmojis.ts | 2 +- app/lib/methods/loadThreadMessages.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/lib/methods/getCustomEmojis.ts b/app/lib/methods/getCustomEmojis.ts index ab6187196b..b463031012 100644 --- a/app/lib/methods/getCustomEmojis.ts +++ b/app/lib/methods/getCustomEmojis.ts @@ -62,7 +62,7 @@ const updateEmojis = async ({ update = [], remove = [], allRecords }: IUpdateEmo try { await db.write(async () => { - await db.batch(emojisToCreate, ...emojisToUpdate, ...emojisToDelete); + await db.batch([...emojisToCreate, ...emojisToUpdate, ...emojisToDelete]); }); return true; } catch (e) { diff --git a/app/lib/methods/loadThreadMessages.ts b/app/lib/methods/loadThreadMessages.ts index 73835b9ec8..37655109a5 100644 --- a/app/lib/methods/loadThreadMessages.ts +++ b/app/lib/methods/loadThreadMessages.ts @@ -73,7 +73,7 @@ export function loadThreadMessages({ tmid, rid }: { tmid: string; rid: string }) }); await db.write(async () => { - await db.batch(threadMessagesToCreate, ...threadMessagesToUpdate); + await db.batch([...threadMessagesToCreate, ...threadMessagesToUpdate]); }); } catch (e) { log(e);