Open aviculturist opened 3 years ago
Wrapping handleSignOut I was able to solve this:
const handleHandleSignOut = () => {
const darkMode = localStorage.getItem('darkMode') || '';
handleSignOut();
if (darkMode !== '') {
localStorage.setItem('darkMode', darkMode);
}
};
Wiping out localStorage upon sign out makes good sense but some apps use it for state other than stacks state, would be great if we could just remove the micro-stacks-specific localStorage items.
https://github.com/fungible-systems/micro-stacks-react/blob/7f6835a1e6ab56b4b872b97babd54285fce2d9e5/packages/react/src/hooks/use-auth.ts#L43