fix notifikasi forum
deskripsi: - fix load data notifikasi: forum
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
"use client";
|
||||
import { gs_count_ntf, gs_user_ntf } from "@/lib/global_state";
|
||||
import { gs_user_ntf } from "@/lib/global_state";
|
||||
import { useShallowEffect } from "@mantine/hooks";
|
||||
import { useAtom } from "jotai";
|
||||
import { useState } from "react";
|
||||
@@ -22,7 +22,7 @@ export default function HomeView({
|
||||
}) {
|
||||
const [countNtf, setCountNtf] = useState(countNotifikasi);
|
||||
const [newUserNtf, setNewUserNtf] = useAtom(gs_user_ntf);
|
||||
const [countLoadNtf, setCountLoadNtf] = useAtom(gs_count_ntf);
|
||||
// const [countLoadNtf, setCountLoadNtf] = useAtom(gs_count_ntf);
|
||||
const userRoleId = dataUser.masterUserRoleId;
|
||||
|
||||
// useShallowEffect(() => {
|
||||
@@ -33,15 +33,15 @@ export default function HomeView({
|
||||
// }
|
||||
// }, [userRoleId]);
|
||||
|
||||
useShallowEffect(() => {
|
||||
onLoadNotifikasi({
|
||||
onLoad(val) {
|
||||
setCountNtf(val);
|
||||
},
|
||||
});
|
||||
// useShallowEffect(() => {
|
||||
// onLoadNotifikasi({
|
||||
// onLoad(val) {
|
||||
// setCountNtf(val);
|
||||
// },
|
||||
// });
|
||||
|
||||
setCountNtf(countLoadNtf as any);
|
||||
}, [countLoadNtf, setCountNtf]);
|
||||
// setCountNtf(countLoadNtf as any);
|
||||
// }, [countLoadNtf, setCountNtf]);
|
||||
|
||||
useShallowEffect(() => {
|
||||
setCountNtf(countNtf + newUserNtf);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
"use client";
|
||||
import { gs_count_ntf, gs_user_ntf } from "@/lib/global_state";
|
||||
import { gs_user_ntf } from "@/lib/global_state";
|
||||
import global_limit from "@/lib/limit";
|
||||
import { RouterProfile } from "@/lib/router_hipmi/router_katalog";
|
||||
import { RouterNotifikasi } from "@/lib/router_hipmi/router_notifikasi";
|
||||
@@ -20,7 +20,7 @@ import FooterHome from "./component/footer_home";
|
||||
import { apiGetDataHome, apiGetNotifikasiHome } from "./fun/get/api_home";
|
||||
|
||||
export default function HomeViewNew() {
|
||||
const [countNtf, setCountNtf] = useAtom(gs_count_ntf);
|
||||
const [countNtf, setCountNtf] = useState<number | null>(null);
|
||||
const [newUserNtf, setNewUserNtf] = useAtom(gs_user_ntf);
|
||||
const [dataUser, setDataUser] = useState<any | null>(null);
|
||||
const [categoryPage, setCategoryPage] = useAtom(gs_notifikasi_kategori_app);
|
||||
@@ -31,7 +31,7 @@ export default function HomeViewNew() {
|
||||
setCountNtf(countNtf + newUserNtf);
|
||||
setNewUserNtf(0);
|
||||
}
|
||||
}, [newUserNtf, countNtf]);
|
||||
}, [newUserNtf]);
|
||||
|
||||
useShallowEffect(() => {
|
||||
hanlderLoadData();
|
||||
|
||||
Reference in New Issue
Block a user