feat: live feed toggle

This commit is contained in:
codytseng 2026-01-04 20:42:20 +08:00
parent 89bb9ad2d0
commit 917fcd9839
26 changed files with 130 additions and 26 deletions

View file

@ -64,6 +64,7 @@ class LocalStorageService {
private quickReactionEmoji: string | TEmoji = '+'
private nsfwDisplayPolicy: TNsfwDisplayPolicy = NSFW_DISPLAY_POLICY.HIDE_CONTENT
private minTrustScore: number = 40
private enableLiveFeed: boolean = false
constructor() {
if (!LocalStorageService.instance) {
@ -275,6 +276,8 @@ class LocalStorageService {
}
}
this.enableLiveFeed = window.localStorage.getItem(StorageKey.ENABLE_LIVE_FEED) === 'true'
// Clean up deprecated data
window.localStorage.removeItem(StorageKey.PINNED_PUBKEYS)
window.localStorage.removeItem(StorageKey.ACCOUNT_PROFILE_EVENT_MAP)
@ -612,6 +615,15 @@ class LocalStorageService {
window.localStorage.setItem(StorageKey.MIN_TRUST_SCORE, score.toString())
}
}
getEnableLiveFeed() {
return this.enableLiveFeed
}
setEnableLiveFeed(enable: boolean) {
this.enableLiveFeed = enable
window.localStorage.setItem(StorageKey.ENABLE_LIVE_FEED, enable.toString())
}
}
const instance = new LocalStorageService()