Show a page reload prompt on EME toggle (#4994) * Show a page reload prompt on EME toggle #4992 * Fix lint * Orange toast
Signed| @@ -3,7 +3,6 @@ | ||
| 3 | 3 | /** @typedef {import('chevrotain').ILexingError} ILexingError */ |
| 4 | 4 | /** @typedef {import('chevrotain').IRecognitionException} IRecognitionException */ |
| 5 | 5 | |
| 6 | -import { saveSettingsDebounced } from '/script.js'; | |
| 7 | 6 | import { t } from '/scripts/i18n.js'; |
| 8 | 7 | import { Popup, POPUP_RESULT } from '/scripts/popup.js'; |
| 9 | 8 | import { power_user } from '/scripts/power-user.js'; |
| @@ -61,8 +60,7 @@ async function onboardingExperimentalMacroEngineUnsafe(feature = null) { | ||
| 61 | 60 | <p>${t`Would you like to enable it now?`}</p>`); |
| 62 | 61 | if (result == POPUP_RESULT.AFFIRMATIVE) { |
| 63 | 62 | power_user.experimental_macro_engine = true; |
| 64 | 63 | $('#experimental_macro_engine').prop('checked', power_user.experimental_macro_engine).trigger('input'); |
| 65 | - saveSettingsDebounced(); | |
| 66 | 64 | } |
| 67 | 65 | |
| 68 | 66 | // Only show this once |
| @@ -4015,6 +4015,18 @@ jQuery(() => { | ||
| 4015 | 4015 | $('#experimental_macro_engine').on('input', function () { |
| 4016 | 4016 | power_user.experimental_macro_engine = !!$(this).prop('checked'); |
| 4017 | 4017 | saveSettingsDebounced(); |
| 4018 | + | |
| 4019 | + eventSource.once(event_types.SETTINGS_UPDATED, function() { | |
| 4020 | + toastr.warning( | |
| 4021 | + t`Click here to reload.`, | |
| 4022 | + t`Toggling the Experimental Macro Engine requires a reload.`, | |
| 4023 | + { | |
| 4024 | + onclick: () => window.location.reload(), | |
| 4025 | + timeOut: 10000, | |
| 4026 | + preventDuplicates: true, | |
| 4027 | + }, | |
| 4028 | + ); | |
| 4029 | + }); | |
| 4018 | 4030 | }); |
| 4019 | 4031 | |
| 4020 | 4032 | $('#disable_group_trimming').on('input', function () { |