Desc:
- Perubahan minor
No issue
This commit is contained in:
2023-10-04 17:56:41 +08:00
parent 90692d7eff
commit a556fe63fc
8 changed files with 18 additions and 6 deletions

View File

@@ -34,6 +34,8 @@ import { getProfile } from "../katalog/profile";
import { useRouter } from "next/navigation";
import { useAtom } from "jotai";
import { gs_token } from "./state/global_state";
import { g_getProfile } from "../katalog/profile/fun/fun_get_profile";
import { gs_profile } from "../katalog/profile/state/global_state";
const listHalaman = [
{
@@ -81,7 +83,7 @@ const listHalaman = [
export default function HomeView() {
const router = useRouter();
const [token, setToken] = useAtom(gs_token);
const [profile, setProfile] = useState<any | null>(null);
useShallowEffect(() => {
getUserId();
@@ -91,13 +93,10 @@ export default function HomeView() {
setToken(data);
}
const [profile, setProfile] = useAtom(gs_profile);
useShallowEffect(() => {
getUserProfile();
g_getProfile(setProfile);
}, []);
async function getUserProfile() {
const data = await getProfile();
setProfile(data);
}
return (
<>