Fix rate-limiting when setting options from options page

This commit is contained in:
Ajay
2024-03-07 17:20:23 -05:00
parent 63d3309605
commit e9b7abd219
2 changed files with 3 additions and 4 deletions

View File

@@ -286,7 +286,7 @@ async function init() {
break; break;
case "resetToDefault": case "resetToDefault":
Config.resetToDefault(); Config.resetToDefault();
window.location.reload(); setTimeout(() => window.location.reload(), 200);
break; break;
} }
}); });
@@ -632,8 +632,7 @@ async function setTextOption(option: string, element: HTMLElement, value: string
await invidiousOnClick(checkbox, "supportInvidious"); await invidiousOnClick(checkbox, "supportInvidious");
} }
window.location.reload(); setTimeout(() => window.location.reload(), 200);
} catch (e) { } catch (e) {
alert(chrome.i18n.getMessage("incorrectlyFormattedOptions")); alert(chrome.i18n.getMessage("incorrectlyFormattedOptions"));
} }