This commit is contained in:
2026-06-16 10:29:42 +08:00
parent 077fd3cdc6
commit c9c41f0183
2 changed files with 11 additions and 7 deletions
@@ -27,11 +27,10 @@ const NotificationPopup: React.FC = () => {
const fetchNotifications = useCallback(async () => {
try {
const result = await getNotifications();
const result = await getNotifications(1, 20, false);
const data = result.items || [];
const unread = data.filter((n: Notification) => !n.isRead);
setNotifications(unread);
if (unread.length > 0 && !visible) {
setNotifications(data);
if (data.length > 0 && !visible) {
setVisible(true);
setCurrentIndex(0);
}