Reset flows cache when logged out

This commit is contained in:
Lucas Oliveira 2023-08-30 10:34:30 -03:00
commit 34da831213

View file

@ -72,7 +72,7 @@ export const TabsContext = createContext<TabsContextType>(
export function TabsProvider({ children }: { children: ReactNode }) {
const { setErrorData, setNoticeData, setSuccessData } =
useContext(alertContext);
const { getAuthentication } = useContext(AuthContext);
const { getAuthentication, isAuthenticated } = useContext(AuthContext);
const [tabId, setTabId] = useState("");
@ -86,6 +86,12 @@ export function TabsProvider({ children }: { children: ReactNode }) {
const [tabsState, setTabsState] = useState<TabsState>({});
const [getTweak, setTweak] = useState<tweakType>([]);
useEffect(() => {
if(!isAuthenticated){
hardReset();
}
}, [isAuthenticated])
const newNodeId = useRef(uid());
function incrementNodeId() {
newNodeId.current = uid();