@lvce-editor/renderer-process 30.66.0 → 30.67.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rendererProcessMain.js +23 -0
- package/package.json +1 -1
|
@@ -11457,6 +11457,28 @@ const unmaximize = () => {};
|
|
|
11457
11457
|
const close = () => {
|
|
11458
11458
|
// window.close()
|
|
11459
11459
|
};
|
|
11460
|
+
|
|
11461
|
+
// User confirmation has no deadline; the main process persists session state only after approval.
|
|
11462
|
+
const canClose = async () => {
|
|
11463
|
+
if (!(await invoke$1('Main.hasDirtyTabs'))) {
|
|
11464
|
+
return true;
|
|
11465
|
+
}
|
|
11466
|
+
const choice = await invoke$1('ConfirmPrompt.prompt3', 'Do you want to save your changes before closing?', {
|
|
11467
|
+
cancelMessage: 'Cancel',
|
|
11468
|
+
confirmMessage: 'Save',
|
|
11469
|
+
discardMessage: "Don't Save",
|
|
11470
|
+
discardPrompt: 'Discard your unsaved changes?',
|
|
11471
|
+
title: 'Save Changes'
|
|
11472
|
+
});
|
|
11473
|
+
if (choice === 'discard') {
|
|
11474
|
+
return true;
|
|
11475
|
+
}
|
|
11476
|
+
if (choice !== 'save') {
|
|
11477
|
+
return false;
|
|
11478
|
+
}
|
|
11479
|
+
await invoke$1('Main.saveAll');
|
|
11480
|
+
return !(await invoke$1('Main.hasDirtyTabs'));
|
|
11481
|
+
};
|
|
11460
11482
|
const prepareClose = async () => {
|
|
11461
11483
|
await invoke$1('SaveState.handleVisibilityChange', 'hidden');
|
|
11462
11484
|
};
|
|
@@ -11990,6 +12012,7 @@ const commandMap = {
|
|
|
11990
12012
|
'WebView.load': load,
|
|
11991
12013
|
'WebView.loadOnly': loadOnly,
|
|
11992
12014
|
'WebView.setPort': setPort,
|
|
12015
|
+
'Window.canClose': canClose,
|
|
11993
12016
|
'Window.captureBrowserAddress': captureBrowserAddress,
|
|
11994
12017
|
'Window.close': close,
|
|
11995
12018
|
'Window.focusBrowserAddress': focusBrowserAddress,
|