Add loading guard before enforcing access
cgen-d4632589f4d14867b63863a82d10eddc
This commit is contained in:
parent
1c3980547d
commit
3c09969601
1 changed files with 2 additions and 1 deletions
|
|
@ -41,6 +41,7 @@ export default function ProjectsAdmin() {
|
|||
});
|
||||
|
||||
useEffect(() => {
|
||||
if (authLoading) return;
|
||||
if (!isOwner) return;
|
||||
setLoading(true);
|
||||
supabase
|
||||
|
|
@ -49,7 +50,7 @@ export default function ProjectsAdmin() {
|
|||
.order("created_at", { ascending: false })
|
||||
.then(({ data }) => setList(data || []))
|
||||
.finally(() => setLoading(false));
|
||||
}, [isOwner]);
|
||||
}, [authLoading, isOwner]);
|
||||
|
||||
const create = async () => {
|
||||
const tags = (draft.tags || "")
|
||||
|
|
|
|||
Loading…
Reference in a new issue