Skip to content

armgit / plane

Public Imported from GitHub
0

πŸ”₯πŸ”₯πŸ”₯ Open-source Jira, Linear, Monday, and ClickUp alternative. Plane is a modern project management platform to manage tasks, sprints, docs, and triage.

[WEB-5772] chore: theme switcher code refactor #8438

Anmol Singh Bhatiad09c91b8383d
diff --git a/apps/web/app/(all)/profile/appearance/page.tsx b/apps/web/app/(all)/profile/appearance/page.tsx
index 0104310217..d0d05588d8 100644
--- a/apps/web/app/(all)/profile/appearance/page.tsx
+++ b/apps/web/app/(all)/profile/appearance/page.tsx
@@ -63,9 +63,7 @@ function ProfileAppearancePage() {
// Wait for the promise to resolve, then reload after showing toast
try {
await updateCurrentUserThemePromise;
- setTimeout(() => {
- window.location.reload();
- }, 1500);
+ window.location.reload();
} catch (error) {
// Error toast already shown by setPromiseToast
console.error("Error updating theme:", error);
diff --git a/apps/web/ce/components/preferences/theme-switcher.tsx b/apps/web/ce/components/preferences/theme-switcher.tsx
index 9de9b96162..d6e6dc252c 100644
--- a/apps/web/ce/components/preferences/theme-switcher.tsx
+++ b/apps/web/ce/components/preferences/theme-switcher.tsx
@@ -67,9 +67,7 @@ export const ThemeSwitcher = observer(function ThemeSwitcher(props: {
});
// Wait for the promise to resolve, then reload after showing toast
await updatePromise;
- setTimeout(() => {
- window.location.reload();
- }, 1500);
+ window.location.reload();
} catch (error) {
console.error("Error updating theme:", error);
}
diff --git a/apps/web/core/components/power-k/config/preferences-commands.ts b/apps/web/core/components/power-k/config/preferences-commands.ts
index 116b0ddba9..6e6ad8e864 100644
--- a/apps/web/core/components/power-k/config/preferences-commands.ts
+++ b/apps/web/core/components/power-k/config/preferences-commands.ts
@@ -32,9 +32,7 @@ export const usePowerKPreferencesCommands = (): TPowerKCommandConfig[] => {
message: "Reloading to apply changes...",
});
// reload the page after showing the toast
- setTimeout(() => {
- window.location.reload();
- }, 1500);
+ window.location.reload();
return;
})
.catch(() => {