#3809 Add beforeunload event listener to prompt user when chat is saving

6f543e860fb5216f0208f7737c78357ef929414d

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

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