Save chat before reloading

This commit is contained in:
Cohee
2023-12-06 17:23:54 +02:00
parent bca43b11fa
commit 64496425cc

View File

@ -17,6 +17,8 @@ import {
chat, chat,
getFirstDisplayedMessageId, getFirstDisplayedMessageId,
showMoreMessages, showMoreMessages,
saveSettings,
saveChatConditional,
} from '../script.js'; } from '../script.js';
import { isMobile, initMovingUI, favsToHotswap } from './RossAscends-mods.js'; import { isMobile, initMovingUI, favsToHotswap } from './RossAscends-mods.js';
import { import {
@ -2889,10 +2891,12 @@ $(document).ready(() => {
saveSettingsDebounced(); saveSettingsDebounced();
}); });
$('#reload_chat').on('click', function () { $('#reload_chat').on('click', async function () {
const currentChatId = getCurrentChatId(); const currentChatId = getCurrentChatId();
if (currentChatId !== undefined && currentChatId !== null) { if (currentChatId !== undefined && currentChatId !== null) {
reloadCurrentChat(); await saveSettings();
await saveChatConditional();
await reloadCurrentChat();
} }
}); });