fix: load refresh notifikasi list
This commit is contained in:
@@ -2,7 +2,7 @@ import { NextResponse } from "next/server";
|
|||||||
|
|
||||||
export async function GET(request: Request) {
|
export async function GET(request: Request) {
|
||||||
try {
|
try {
|
||||||
return NextResponse.json({ success: true, version: "1.3.3", tahap: "beta", update: "- update baru : menampilkan notifikasi pengumuman setelah login (fixed tampilan); - rich text di pengumuman (tambah dan edit); - fitur tandai dibaca semua notifikasi" }, { status: 200 });
|
return NextResponse.json({ success: true, version: "1.3.4", tahap: "beta", update: "- update baru : menampilkan notifikasi pengumuman setelah login (fixed tampilan); - rich text di pengumuman (tambah dan edit); - fitur tandai dibaca semua notifikasi" }, { status: 200 });
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(error);
|
console.error(error);
|
||||||
return NextResponse.json({ success: false, version: "Gagal mendapatkan version, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });
|
return NextResponse.json({ success: false, version: "Gagal mendapatkan version, coba lagi nanti (error: 500)", reason: (error as Error).message, }, { status: 500 });
|
||||||
|
|||||||
@@ -49,7 +49,15 @@ export default function ListNotification() {
|
|||||||
|
|
||||||
useShallowEffect(() => {
|
useShallowEffect(() => {
|
||||||
fetchData(false);
|
fetchData(false);
|
||||||
}, [isPage, reloadNotif.get()]);
|
}, [isPage]);
|
||||||
|
|
||||||
|
useShallowEffect(() => {
|
||||||
|
if (isPage != 1) {
|
||||||
|
setPage(1)
|
||||||
|
} else {
|
||||||
|
fetchData(false)
|
||||||
|
}
|
||||||
|
}, [reloadNotif.get()]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
const handleScroll = async () => {
|
const handleScroll = async () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user