Merge pull request #3810 from SillyTavern/onbeforeunload Add beforeunload event listener to prompt user when chat is saving

571356ffd9c57625112152f853bd924a530a2832

Cohee <18619528+Cohee1207@users.noreply.github.com>

Signed
1 files changed, +7 -0Showing whitespace changes
public/script.js+7 -0
@@ -12209,4 +12209,11 @@ jQuery(async function () {
12209 });12209 });
1221012210
12211 initCustomSelectedSamplers();12211 initCustomSelectedSamplers();
12212
12213 window.addEventListener('beforeunload', (e) => {
12214 if (isChatSaving) {
12215 e.preventDefault();
12216 e.returnValue = true;
12217 }
12218 });
12212});12219});