♻️ (authContext.tsx): remove unused import and comment out unused code
🐛 (flowSettingsModal): fix potential null reference error in useEffect dependencies
This commit is contained in:
parent
e98e3f5387
commit
84df4fd8e4
2 changed files with 3 additions and 4 deletions
|
|
@ -3,7 +3,6 @@ import { useNavigate } from "react-router-dom";
|
||||||
import Cookies from "universal-cookie";
|
import Cookies from "universal-cookie";
|
||||||
import { getLoggedUser, requestLogout } from "../controllers/API";
|
import { getLoggedUser, requestLogout } from "../controllers/API";
|
||||||
import useAlertStore from "../stores/alertStore";
|
import useAlertStore from "../stores/alertStore";
|
||||||
import { useFolderStore } from "../stores/foldersStore";
|
|
||||||
import { Users } from "../types/api";
|
import { Users } from "../types/api";
|
||||||
import { AuthContextType } from "../types/contexts/auth";
|
import { AuthContextType } from "../types/contexts/auth";
|
||||||
|
|
||||||
|
|
@ -43,7 +42,7 @@ export function AuthProvider({ children }): React.ReactElement {
|
||||||
const [apiKey, setApiKey] = useState<string | null>(
|
const [apiKey, setApiKey] = useState<string | null>(
|
||||||
cookies.get("apikey_tkn_lflw"),
|
cookies.get("apikey_tkn_lflw"),
|
||||||
);
|
);
|
||||||
const getFoldersApi = useFolderStore((state) => state.getFoldersApi);
|
// const getFoldersApi = useFolderStore((state) => state.getFoldersApi);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const storedAccessToken = cookies.get("access_token_lf");
|
const storedAccessToken = cookies.get("access_token_lf");
|
||||||
|
|
@ -65,7 +64,7 @@ export function AuthProvider({ children }): React.ReactElement {
|
||||||
setUserData(user);
|
setUserData(user);
|
||||||
const isSuperUser = user!.is_superuser;
|
const isSuperUser = user!.is_superuser;
|
||||||
setIsAdmin(isSuperUser);
|
setIsAdmin(isSuperUser);
|
||||||
await getFoldersApi(true);
|
// await getFoldersApi(true);
|
||||||
})
|
})
|
||||||
.catch((error) => {
|
.catch((error) => {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ export default function FlowSettingsModal({
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setName(currentFlow!.name);
|
setName(currentFlow!.name);
|
||||||
setDescription(currentFlow!.description);
|
setDescription(currentFlow!.description);
|
||||||
}, [currentFlow!.name, currentFlow!.description, open]);
|
}, [currentFlow?.name, currentFlow?.description, open]);
|
||||||
|
|
||||||
const [name, setName] = useState(currentFlow!.name);
|
const [name, setName] = useState(currentFlow!.name);
|
||||||
const [description, setDescription] = useState(currentFlow!.description);
|
const [description, setDescription] = useState(currentFlow!.description);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue