feat: Refactor duplicates management with user preference for notification visibility and modular banner component, fixes #359

This commit is contained in:
Will Miao
2025-08-16 09:14:35 +08:00
parent 83d1828905
commit dcb9983786
6 changed files with 170 additions and 76 deletions

View File

@@ -254,4 +254,20 @@ export function resetDismissedBanner(bannerId) {
const dismissedBanners = getStorageItem('dismissed_banners', []);
const updatedBanners = dismissedBanners.filter(id => id !== bannerId);
setStorageItem('dismissed_banners', updatedBanners);
}
/**
* Get the show duplicates notification preference
* @returns {boolean} True if notification should be shown (default: true)
*/
export function getShowDuplicatesNotification() {
return getStorageItem('show_duplicates_notification', true);
}
/**
* Set the show duplicates notification preference
* @param {boolean} show - Whether to show the notification
*/
export function setShowDuplicatesNotification(show) {
setStorageItem('show_duplicates_notification', show);
}