Merge branch 'fix-extensions-toggle' into staging
| @@ -660,6 +660,8 @@ async function showExtensionsDetails() { | ||
| 660 | 660 | await oldPopup.complete(POPUP_RESULT.CANCELLED); |
| 661 | 661 | } |
| 662 | 662 | |
| 663 | + let waitingForSave = false; | |
| 664 | + | |
| 663 | 665 | const popup = new Popup(html, POPUP_TYPE.TEXT, '', { |
| 664 | 666 | okButton: 'Close', |
| 665 | 667 | wide: true, |
| @@ -667,9 +669,14 @@ async function showExtensionsDetails() { | ||
| 667 | 669 | customButtons: [updateAllButton], |
| 668 | 670 | allowVerticalScrolling: true, |
| 669 | 671 | onClosing: async () => { |
| 672 | + if (waitingForSave) { | |
| 673 | + return false; | |
| 674 | + } | |
| 670 | 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 | 678 | await saveSettings(); |
| 679 | + toastr.clear(toast); | |
| 673 | 680 | } |
| 674 | 681 | return true; |
| 675 | 682 | }, |