feat: hide content mentioning muted users (#524)

Co-authored-by: mleku <me@mleku.dev>
This commit is contained in:
Cody Tseng
2025-09-02 22:18:34 +08:00
committed by GitHub
parent d3578184fb
commit 3c657dfa8c
37 changed files with 289 additions and 83 deletions

View File

@@ -35,6 +35,7 @@ class LocalStorageService {
private defaultShowNsfw: boolean = false
private dismissedTooManyRelaysAlert: boolean = false
private showKinds: number[] = []
private hideContentMentioningMutedUsers: boolean = false
constructor() {
if (!LocalStorageService.instance) {
@@ -156,6 +157,9 @@ class LocalStorageService {
window.localStorage.setItem(StorageKey.SHOW_KINDS, JSON.stringify(this.showKinds))
window.localStorage.setItem(StorageKey.SHOW_KINDS_VERSION, '1')
this.hideContentMentioningMutedUsers =
window.localStorage.getItem(StorageKey.HIDE_CONTENT_MENTIONING_MUTED_USERS) === 'true'
// Clean up deprecated data
window.localStorage.removeItem(StorageKey.ACCOUNT_PROFILE_EVENT_MAP)
window.localStorage.removeItem(StorageKey.ACCOUNT_FOLLOW_LIST_EVENT_MAP)
@@ -397,6 +401,15 @@ class LocalStorageService {
this.showKinds = kinds
window.localStorage.setItem(StorageKey.SHOW_KINDS, JSON.stringify(kinds))
}
getHideContentMentioningMutedUsers() {
return this.hideContentMentioningMutedUsers
}
setHideContentMentioningMutedUsers(hide: boolean) {
this.hideContentMentioningMutedUsers = hide
window.localStorage.setItem(StorageKey.HIDE_CONTENT_MENTIONING_MUTED_USERS, hide.toString())
}
}
const instance = new LocalStorageService()