Prevent duplicate toasts

112200ae329997296e82d2f11ccbfcfc12bba1fb

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

1 files changed, +8 -1Ignore whitespace
public/scripts/extensions.js+8 -1
@@ -660,6 +660,8 @@ async function showExtensionsDetails() {
660660 await oldPopup.complete(POPUP_RESULT.CANCELLED);
661661 }
662662
663+ let waitingForSave = false;
664+
663665 const popup = new Popup(html, POPUP_TYPE.TEXT, '', {
664666 okButton: 'Close',
665667 wide: true,
@@ -667,9 +669,14 @@ async function showExtensionsDetails() {
667669 customButtons: [updateAllButton],
668670 allowVerticalScrolling: true,
669671 onClosing: async () => {
672+ if (waitingForSave) {
673+ return false;
674+ }
670675 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');
672678 await saveSettings();
679+ toastr.clear(toast);
673680 }
674681 return true;
675682 },