Merge pull request #3810 from SillyTavern/onbeforeunload Add beforeunload event listener to prompt user when chat is saving
Signed| @@ -12209,4 +12209,11 @@ jQuery(async function () { | |||
| 12209 | }); | 12209 | }); |
| 12210 | 12210 | ||
| 12211 | initCustomSelectedSamplers(); | 12211 | initCustomSelectedSamplers(); |
| 12212 | |||
| 12213 | window.addEventListener('beforeunload', (e) => { | ||
| 12214 | if (isChatSaving) { | ||
| 12215 | e.preventDefault(); | ||
| 12216 | e.returnValue = true; | ||
| 12217 | } | ||
| 12218 | }); | ||
| 12212 | }); | 12219 | }); |