Skip to content

Commit

Permalink
제발
Browse files Browse the repository at this point in the history
  • Loading branch information
ipcgrdn committed Nov 20, 2024
1 parent 6dccbb2 commit 9fdd2d7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/provider/userProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { useAuth } from "./authProvider";
export interface Artist {
uuid: string;
name: string;
role: 'ROLE_USER';
role: string;
email: string;
artistImage: string;
}
Expand All @@ -33,6 +33,12 @@ export function UserProvider({ children }: { children: React.ReactNode }) {
const router = useRouter();

const fetchUser = async () => {
if (!isLoggedIn) {
setUser(null);
setIsLoading(false);
return;
}

try {
const { data } = await api.get<Artist>("/artist");

Expand Down Expand Up @@ -70,12 +76,6 @@ export function UserProvider({ children }: { children: React.ReactNode }) {
};

useEffect(() => {
if (!isLoggedIn) {
setUser(null);
setIsLoading(false);
return;
}

fetchUser();
}, [isLoggedIn]);

Expand Down

0 comments on commit 9fdd2d7

Please sign in to comment.