Skip to content

Commit

Permalink
fix: migrate old appearance settings
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed May 31, 2022
1 parent 8ae3848 commit dfd92fe
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/widget/src/hooks/useSettings/useSettingsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,13 @@ export const useSettingsStore = create<SettingsStore>()(
}),
{
name: 'li.fi-widget-settings',
// partialize: (state) => ({ }),
version: 1,
migrate: (persistedState: any, version) => {
if (version === 0 && persistedState.appearance === 'system') {
persistedState.appearance = 'auto';
}
return persistedState as SettingsStore;
},
},
),
);
Expand Down

0 comments on commit dfd92fe

Please sign in to comment.