feat: hide replies from untrusted users
This commit is contained in:
parent
4785efd43c
commit
1bd8ee03b1
8 changed files with 159 additions and 24 deletions
|
|
@ -25,6 +25,7 @@ class LocalStorageService {
|
|||
private accountFeedInfoMap: Record<string, TFeedInfo | undefined> = {}
|
||||
private mediaUploadService: string = DEFAULT_NIP_96_SERVICE
|
||||
private autoplay: boolean = true
|
||||
private hideUntrustedReplies: boolean = true
|
||||
|
||||
constructor() {
|
||||
if (!LocalStorageService.instance) {
|
||||
|
|
@ -92,6 +93,9 @@ class LocalStorageService {
|
|||
|
||||
this.autoplay = window.localStorage.getItem(StorageKey.AUTOPLAY) !== 'false'
|
||||
|
||||
this.hideUntrustedReplies =
|
||||
window.localStorage.getItem(StorageKey.HIDE_UNTRUSTED_REPLIES) !== 'false'
|
||||
|
||||
// Clean up deprecated data
|
||||
window.localStorage.removeItem(StorageKey.ACCOUNT_PROFILE_EVENT_MAP)
|
||||
window.localStorage.removeItem(StorageKey.ACCOUNT_FOLLOW_LIST_EVENT_MAP)
|
||||
|
|
@ -247,6 +251,14 @@ class LocalStorageService {
|
|||
this.autoplay = autoplay
|
||||
window.localStorage.setItem(StorageKey.AUTOPLAY, autoplay.toString())
|
||||
}
|
||||
|
||||
getHideUntrustedReplies() {
|
||||
return this.hideUntrustedReplies
|
||||
}
|
||||
setHideUntrustedReplies(hide: boolean) {
|
||||
this.hideUntrustedReplies = hide
|
||||
window.localStorage.setItem(StorageKey.HIDE_UNTRUSTED_REPLIES, hide.toString())
|
||||
}
|
||||
}
|
||||
|
||||
const instance = new LocalStorageService()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue