From b027c04066c48a05419b2b56c5860a1a58e9f10f Mon Sep 17 00:00:00 2001 From: Wolfsblvt Date: Sun, 7 Apr 2024 20:37:05 +0200 Subject: [PATCH] Remove chat save on pick macro --- public/scripts/macros.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/public/scripts/macros.js b/public/scripts/macros.js index ff3aff0d7..a2514da8c 100644 --- a/public/scripts/macros.js +++ b/public/scripts/macros.js @@ -189,10 +189,10 @@ function pickReplace(input, rawContent, emptyListPlaceholder = '') { const pickPattern = /{{pick\s?::?([^}]+)}}/gi; // We need to have a consistent chat hash, otherwise we'll lose rolls on chat file rename or branch switches + // No need to save metadata here - branching and renaming will implicitly do the save for us, and until then loading it like this is consistent const chatIdHash = chat_metadata['chat_id_hash']; if (!chatIdHash) { - chat_metadata['chat_id_hash'] = getStringHash(getCurrentChatId()); - saveMetadataDebounced(); + chat_metadata['chat_id_hash'] = getStringHash(chat_metadata['main_chat'] ?? getCurrentChatId()); } const rawContentHash = getStringHash(rawContent);