mirror of
https://github.com/afoim/fuwari.git
synced 2026-01-31 09:03:18 +08:00
fix(NewPostNotification): 修复更新检测逻辑以包含标题和描述变更
之前仅检测内容变更和发布日期更新,现在扩展检测逻辑以包含标题、描述等元数据的变更,确保任何修改都能正确触发更新通知。
This commit is contained in:
@@ -486,16 +486,21 @@
|
|||||||
// New post
|
// New post
|
||||||
detectedChanges.push({ ...post, isUpdated: false });
|
detectedChanges.push({ ...post, isUpdated: false });
|
||||||
} else {
|
} else {
|
||||||
const dateUpdated = post.pubDate > stored.pubDate;
|
// Check for ANY change (Title, Date, Description, Content)
|
||||||
const contentChanged = post.content && stored.content && post.content !== stored.content;
|
const titleChanged = post.title !== stored.title;
|
||||||
|
const dateChanged = post.pubDate !== stored.pubDate;
|
||||||
|
const descriptionChanged = post.description !== stored.description;
|
||||||
|
const contentChanged = post.content !== stored.content;
|
||||||
|
|
||||||
if (contentChanged) {
|
if (titleChanged || dateChanged || descriptionChanged || contentChanged) {
|
||||||
const diff = computeDiff(stored.content, post.content);
|
// Calculate diff only if content changed
|
||||||
if (diff) {
|
const diff = contentChanged ? computeDiff(stored.content, post.content) : null;
|
||||||
detectedChanges.push({ ...post, isUpdated: true, diff });
|
|
||||||
}
|
detectedChanges.push({
|
||||||
} else if (dateUpdated) {
|
...post,
|
||||||
detectedChanges.push({ ...post, isUpdated: true });
|
isUpdated: true,
|
||||||
|
diff
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ title: 加群向导
|
|||||||
image: /random/h
|
image: /random/h
|
||||||
published: 2025-05-24
|
published: 2025-05-24
|
||||||
pinned: true
|
pinned: true
|
||||||
description: 关于如何联系二叉树树~ 开始技术切磋!
|
description: 关于如何联系二叉树树~
|
||||||
---
|
---
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user