Save chat before reloading

This commit is contained in:
Cohee 2023-12-06 17:23:54 +02:00
parent bca43b11fa
commit 64496425cc
1 changed files with 6 additions and 2 deletions

View File

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