feat: remind users to optimize relay settings
This commit is contained in:
@@ -33,6 +33,7 @@ class LocalStorageService {
|
||||
private translationServiceConfigMap: Record<string, TTranslationServiceConfig> = {}
|
||||
private mediaUploadServiceConfigMap: Record<string, TMediaUploadServiceConfig> = {}
|
||||
private defaultShowNsfw: boolean = false
|
||||
private dismissedTooManyRelaysAlert: boolean = false
|
||||
|
||||
constructor() {
|
||||
if (!LocalStorageService.instance) {
|
||||
@@ -134,8 +135,10 @@ class LocalStorageService {
|
||||
this.mediaUploadServiceConfigMap = JSON.parse(mediaUploadServiceConfigMapStr)
|
||||
}
|
||||
|
||||
const defaultShowNsfwStr = window.localStorage.getItem(StorageKey.DEFAULT_SHOW_NSFW)
|
||||
this.defaultShowNsfw = defaultShowNsfwStr === 'true'
|
||||
this.defaultShowNsfw = window.localStorage.getItem(StorageKey.DEFAULT_SHOW_NSFW) === 'true'
|
||||
|
||||
this.dismissedTooManyRelaysAlert =
|
||||
window.localStorage.getItem(StorageKey.DISMISSED_TOO_MANY_RELAYS_ALERT) === 'true'
|
||||
|
||||
// Clean up deprecated data
|
||||
window.localStorage.removeItem(StorageKey.ACCOUNT_PROFILE_EVENT_MAP)
|
||||
@@ -360,6 +363,15 @@ class LocalStorageService {
|
||||
this.defaultShowNsfw = defaultShowNsfw
|
||||
window.localStorage.setItem(StorageKey.DEFAULT_SHOW_NSFW, defaultShowNsfw.toString())
|
||||
}
|
||||
|
||||
getDismissedTooManyRelaysAlert() {
|
||||
return this.dismissedTooManyRelaysAlert
|
||||
}
|
||||
|
||||
setDismissedTooManyRelaysAlert(dismissed: boolean) {
|
||||
this.dismissedTooManyRelaysAlert = dismissed
|
||||
window.localStorage.setItem(StorageKey.DISMISSED_TOO_MANY_RELAYS_ALERT, dismissed.toString())
|
||||
}
|
||||
}
|
||||
|
||||
const instance = new LocalStorageService()
|
||||
|
||||
Reference in New Issue
Block a user