mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
9482cc3a73
* fix: 404 when redirecting user to login page * fix: next_path redirection not working * fix: authentication workflow update in plane deploy --------- Co-authored-by: gurusainath <gurusainath007@gmail.com>
33 lines
915 B
TypeScript
33 lines
915 B
TypeScript
"use client";
|
|
|
|
import { useEffect } from "react";
|
|
// next imports
|
|
import { useRouter } from "next/router";
|
|
// js cookie
|
|
import Cookie from "js-cookie";
|
|
// mobx store
|
|
import { useMobxStore } from "lib/mobx/store-provider";
|
|
import { RootStore } from "store/root";
|
|
|
|
const MobxStoreInit = () => {
|
|
const { user: userStore }: RootStore = useMobxStore();
|
|
|
|
const router = useRouter();
|
|
const { states, labels, priorities } = router.query as { states: string[]; labels: string[]; priorities: string[] };
|
|
|
|
// useEffect(() => {
|
|
// store.issue.userSelectedLabels = labels || [];
|
|
// store.issue.userSelectedPriorities = priorities || [];
|
|
// store.issue.userSelectedStates = states || [];
|
|
// }, [store.issue]);
|
|
|
|
useEffect(() => {
|
|
const authToken = Cookie.get("accessToken") || null;
|
|
if (authToken) userStore.fetchCurrentUser();
|
|
}, [userStore]);
|
|
|
|
return <></>;
|
|
};
|
|
|
|
export default MobxStoreInit;
|