Skip to content
This repository has been archived by the owner on Feb 11, 2023. It is now read-only.

Commit

Permalink
fix: Eliminate Redundancy
Browse files Browse the repository at this point in the history
  • Loading branch information
Sansai-snct committed Dec 16, 2022
1 parent f20d008 commit 1beef82
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/layout/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ const EditLayout: FC<EditLayoutInterface> = ({ children }) => {
const authStateChanged = onAuthStateChanged(auth, async (u) => {
if (u) {
const { id } = router.query;
const i = id as string;
setListid(i);
setListid(id as string);
setLink(`https://alibum.re-taro.dev/share?from=${u.uid}&to=${listid}`);
const res: ListInfo = await getInfo(u.uid, listid);
if (typeof res !== "undefined") setName(res.name);
Expand All @@ -32,7 +31,9 @@ const EditLayout: FC<EditLayoutInterface> = ({ children }) => {
return () => {
authStateChanged();
};
}, [router, listid]);
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [router]);

return (
<Box minH="100vh" bgColor="background.500">
<EditHeader name={name} link={link} />
Expand Down

0 comments on commit 1beef82

Please sign in to comment.