diff --git a/public/script.js b/public/script.js index 1566a83cb..b57dad454 100644 --- a/public/script.js +++ b/public/script.js @@ -12209,4 +12209,11 @@ jQuery(async function () { }); initCustomSelectedSamplers(); + + window.addEventListener('beforeunload', (e) => { + if (isChatSaving) { + e.preventDefault(); + e.returnValue = true; + } + }); });