[WEB-5772] chore: theme switcher code refactor #8438
This commit is contained in:
parent
2bc7080d24
commit
d09c91b838
3 changed files with 3 additions and 9 deletions
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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(() => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue