fix: theme switching fails after multiple consecutive switches (#6387)

This commit is contained in:
Katherine 2025-03-09 07:43:57 +08:00 committed by GitHub
parent a6e03e35b4
commit 3f6ecd65ed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -17,9 +17,6 @@ export function useUpdateThemeSettings() {
const updateUserThemeSettings = useCallback(
async (themeId: number | null) => {
if (themeId === currentUser.data.data.systemSettings?.themeId) {
return;
}
try {
await api.resource('users').updateTheme({
values: {
@ -36,6 +33,7 @@ export function useUpdateThemeSettings() {
},
});
} catch (err) {
console.log(error);
error(err);
}
},