feat: support hiding indirect notifications
This commit is contained in:
parent
331811f683
commit
2cd1ae481b
27 changed files with 196 additions and 38 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue