improve loading performance of settings UI

This commit is contained in:
SethBurkart123
2024-03-27 23:54:53 +11:00
parent 073ba4d0d5
commit 31da7e8ded
5 changed files with 28 additions and 9 deletions
-5
View File
@@ -11,7 +11,6 @@ const useSettingsState = ({ settingsState, setSettingsState }: SettingsProps) =>
if (RanOnce) return;
RanOnce = true;
// get the current settings state
// @ts-expect-error - TODO: Fix this
browser.storage.local.get().then((result: MainConfig) => {
setSettingsState({
@@ -27,10 +26,6 @@ const useSettingsState = ({ settingsState, setSettingsState }: SettingsProps) =>
transparencyEffects: result.transparencyEffects,
theme: result.theme
});
if (result.DarkMode) {
document.body.classList.add('dark');
}
});
});