feat: support hiding indirect notifications

This commit is contained in:
codytseng 2026-01-20 22:47:42 +08:00
parent 331811f683
commit 2cd1ae481b
27 changed files with 196 additions and 38 deletions

View file

@ -68,6 +68,7 @@ class LocalStorageService {
private mutedWords: string[] = []
private minTrustScore: number = 0
private minTrustScoreMap: Record<string, number> = {}
private hideIndirectNotifications: boolean = false
constructor() {
if (!LocalStorageService.instance) {
@ -319,6 +320,9 @@ class LocalStorageService {
}
}
this.hideIndirectNotifications =
window.localStorage.getItem(StorageKey.HIDE_INDIRECT_NOTIFICATIONS) === 'true'
// Clean up deprecated data
window.localStorage.removeItem(StorageKey.PINNED_PUBKEYS)
window.localStorage.removeItem(StorageKey.ACCOUNT_PROFILE_EVENT_MAP)
@ -684,6 +688,15 @@ class LocalStorageService {
this.mutedWords = words
window.localStorage.setItem(StorageKey.MUTED_WORDS, JSON.stringify(this.mutedWords))
}
getHideIndirectNotifications() {
return this.hideIndirectNotifications
}
setHideIndirectNotifications(onlyShow: boolean) {
this.hideIndirectNotifications = onlyShow
window.localStorage.setItem(StorageKey.HIDE_INDIRECT_NOTIFICATIONS, onlyShow.toString())
}
}
const instance = new LocalStorageService()