mirror of
https://github.com/p-stream/p-stream.git
synced 2026-04-10 03:30:40 +00:00
fix missing date types
This commit is contained in:
parent
820f998f53
commit
2feb1c3657
2 changed files with 9 additions and 5 deletions
|
|
@ -154,7 +154,9 @@ export function NotificationModal({ id }: NotificationModalProps) {
|
|||
item.querySelector("category")?.textContent || "";
|
||||
|
||||
// Skip items without essential data
|
||||
if (!guid || !title) {
|
||||
// Use link as fallback for guid if guid is missing
|
||||
const itemGuid = guid || link;
|
||||
if (!itemGuid || !title) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -162,7 +164,7 @@ export function NotificationModal({ id }: NotificationModalProps) {
|
|||
const notificationDate = new Date(pubDate);
|
||||
|
||||
allNotifications.push({
|
||||
guid,
|
||||
guid: itemGuid,
|
||||
title,
|
||||
link,
|
||||
description,
|
||||
|
|
@ -173,7 +175,7 @@ export function NotificationModal({ id }: NotificationModalProps) {
|
|||
|
||||
// Collect GUIDs of notifications older than autoReadDays
|
||||
if (notificationDate <= autoReadDate) {
|
||||
autoReadGuids.push(guid);
|
||||
autoReadGuids.push(itemGuid);
|
||||
}
|
||||
} catch (itemError) {
|
||||
// Skip malformed items
|
||||
|
|
|
|||
|
|
@ -68,12 +68,14 @@ export function useNotifications() {
|
|||
item.querySelector("category")?.textContent || "";
|
||||
|
||||
// Skip items without essential data
|
||||
if (!guid || !title) {
|
||||
// Use link as fallback for guid if guid is missing
|
||||
const itemGuid = guid || link;
|
||||
if (!itemGuid || !title) {
|
||||
return;
|
||||
}
|
||||
|
||||
allNotifications.push({
|
||||
guid,
|
||||
guid: itemGuid,
|
||||
title,
|
||||
link,
|
||||
description,
|
||||
|
|
|
|||
Loading…
Reference in a new issue