mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-14 12:23:44 +02:00
Don't use a persisted setting when switching users; ref #3021
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { Dispatch, SetStateAction, useEffect, useState } from 'react';
|
||||
|
||||
export function usePersistedState<S = undefined> (key: string, defaultValue: S): [S | undefined, Dispatch<SetStateAction<S | undefined>>] {
|
||||
export function usePersistedState<S = undefined> (key: string, defaultValue: S): [ S | undefined, Dispatch<SetStateAction<S | undefined>> ] {
|
||||
const [ state, setState ] = useState(
|
||||
() => {
|
||||
try {
|
||||
@@ -12,7 +12,7 @@ export function usePersistedState<S = undefined> (key: string, defaultValue: S):
|
||||
|
||||
return defaultValue;
|
||||
}
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user