Skip to content

Commit d09c91b

Browse files
[WEB-5772] chore: theme switcher code refactor #8438
1 parent 2bc7080 commit d09c91b

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

apps/web/app/(all)/profile/appearance/page.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,7 @@ function ProfileAppearancePage() {
6363
// Wait for the promise to resolve, then reload after showing toast
6464
try {
6565
await updateCurrentUserThemePromise;
66-
setTimeout(() => {
67-
window.location.reload();
68-
}, 1500);
66+
window.location.reload();
6967
} catch (error) {
7068
// Error toast already shown by setPromiseToast
7169
console.error("Error updating theme:", error);

apps/web/ce/components/preferences/theme-switcher.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,9 +67,7 @@ export const ThemeSwitcher = observer(function ThemeSwitcher(props: {
6767
});
6868
// Wait for the promise to resolve, then reload after showing toast
6969
await updatePromise;
70-
setTimeout(() => {
71-
window.location.reload();
72-
}, 1500);
70+
window.location.reload();
7371
} catch (error) {
7472
console.error("Error updating theme:", error);
7573
}

apps/web/core/components/power-k/config/preferences-commands.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ export const usePowerKPreferencesCommands = (): TPowerKCommandConfig[] => {
3232
message: "Reloading to apply changes...",
3333
});
3434
// reload the page after showing the toast
35-
setTimeout(() => {
36-
window.location.reload();
37-
}, 1500);
35+
window.location.reload();
3836
return;
3937
})
4038
.catch(() => {

0 commit comments

Comments
 (0)