♻️ (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 { getLoggedUser, requestLogout } from "../controllers/API";
|
||||
import useAlertStore from "../stores/alertStore";
|
||||
import { useFolderStore } from "../stores/foldersStore";
|
||||
import { Users } from "../types/api";
|
||||
import { AuthContextType } from "../types/contexts/auth";
|
||||
|
||||
|
|
@ -43,7 +42,7 @@ export function AuthProvider({ children }): React.ReactElement {
|
|||
const [apiKey, setApiKey] = useState<string | null>(
|
||||
cookies.get("apikey_tkn_lflw"),
|
||||
);
|
||||
const getFoldersApi = useFolderStore((state) => state.getFoldersApi);
|
||||
// const getFoldersApi = useFolderStore((state) => state.getFoldersApi);
|
||||
|
||||
useEffect(() => {
|
||||
const storedAccessToken = cookies.get("access_token_lf");
|
||||
|
|
@ -65,7 +64,7 @@ export function AuthProvider({ children }): React.ReactElement {
|
|||
setUserData(user);
|
||||
const isSuperUser = user!.is_superuser;
|
||||
setIsAdmin(isSuperUser);
|
||||
await getFoldersApi(true);
|
||||
// await getFoldersApi(true);
|
||||
})
|
||||
.catch((error) => {
|
||||
setLoading(false);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ export default function FlowSettingsModal({
|
|||
useEffect(() => {
|
||||
setName(currentFlow!.name);
|
||||
setDescription(currentFlow!.description);
|
||||
}, [currentFlow!.name, currentFlow!.description, open]);
|
||||
}, [currentFlow?.name, currentFlow?.description, open]);
|
||||
|
||||
const [name, setName] = useState(currentFlow!.name);
|
||||
const [description, setDescription] = useState(currentFlow!.description);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue