Prevent duplicate toasts

112200ae329997296e82d2f11ccbfcfc12bba1fb

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

1 files changed, +8 -1Showing whitespace changes
public/scripts/extensions.js+8 -1
@@ -660,6 +660,8 @@ async function showExtensionsDetails() {
660 await oldPopup.complete(POPUP_RESULT.CANCELLED);660 await oldPopup.complete(POPUP_RESULT.CANCELLED);
661 }661 }
662662
663 let waitingForSave = false;
664
663 const popup = new Popup(html, POPUP_TYPE.TEXT, '', {665 const popup = new Popup(html, POPUP_TYPE.TEXT, '', {
664 okButton: 'Close',666 okButton: 'Close',
665 wide: true,667 wide: true,
@@ -667,9 +669,14 @@ async function showExtensionsDetails() {
667 customButtons: [updateAllButton],669 customButtons: [updateAllButton],
668 allowVerticalScrolling: true,670 allowVerticalScrolling: true,
669 onClosing: async () => {671 onClosing: async () => {
672 if (waitingForSave) {
673 return false;
674 }
670 if (stateChanged) {675 if (stateChanged) {
671 toastr.info('The page will be reloaded shortly...', 'Extensions state changed');676 waitingForSave = true;
677 const toast = toastr.info('The page will be reloaded shortly...', 'Extensions state changed');
672 await saveSettings();678 await saveSettings();
679 toastr.clear(toast);
673 }680 }
674 return true;681 return true;
675 },682 },