fix: reset follow list and mute list when switching accounts
This commit is contained in:
parent
9c3d9a5432
commit
46bf0ecc0a
1 changed files with 9 additions and 6 deletions
|
|
@ -34,9 +34,9 @@ type TNostrContext = {
|
||||||
profile: TProfile | null
|
profile: TProfile | null
|
||||||
profileEvent: Event | null
|
profileEvent: Event | null
|
||||||
relayList: TRelayList | null
|
relayList: TRelayList | null
|
||||||
followListEvent?: Event
|
followListEvent: Event | null
|
||||||
muteListEvent?: Event
|
muteListEvent: Event | null
|
||||||
bookmarkListEvent?: Event
|
bookmarkListEvent: Event | null
|
||||||
favoriteRelaysEvent: Event | null
|
favoriteRelaysEvent: Event | null
|
||||||
notificationsSeenAt: number
|
notificationsSeenAt: number
|
||||||
account: TAccountPointer | null
|
account: TAccountPointer | null
|
||||||
|
|
@ -95,9 +95,9 @@ export function NostrProvider({ children }: { children: React.ReactNode }) {
|
||||||
const [profile, setProfile] = useState<TProfile | null>(null)
|
const [profile, setProfile] = useState<TProfile | null>(null)
|
||||||
const [profileEvent, setProfileEvent] = useState<Event | null>(null)
|
const [profileEvent, setProfileEvent] = useState<Event | null>(null)
|
||||||
const [relayList, setRelayList] = useState<TRelayList | null>(null)
|
const [relayList, setRelayList] = useState<TRelayList | null>(null)
|
||||||
const [followListEvent, setFollowListEvent] = useState<Event | undefined>(undefined)
|
const [followListEvent, setFollowListEvent] = useState<Event | null>(null)
|
||||||
const [muteListEvent, setMuteListEvent] = useState<Event | undefined>(undefined)
|
const [muteListEvent, setMuteListEvent] = useState<Event | null>(null)
|
||||||
const [bookmarkListEvent, setBookmarkListEvent] = useState<Event | undefined>(undefined)
|
const [bookmarkListEvent, setBookmarkListEvent] = useState<Event | null>(null)
|
||||||
const [favoriteRelaysEvent, setFavoriteRelaysEvent] = useState<Event | null>(null)
|
const [favoriteRelaysEvent, setFavoriteRelaysEvent] = useState<Event | null>(null)
|
||||||
const [notificationsSeenAt, setNotificationsSeenAt] = useState(-1)
|
const [notificationsSeenAt, setNotificationsSeenAt] = useState(-1)
|
||||||
const [isInitialized, setIsInitialized] = useState(false)
|
const [isInitialized, setIsInitialized] = useState(false)
|
||||||
|
|
@ -138,6 +138,9 @@ export function NostrProvider({ children }: { children: React.ReactNode }) {
|
||||||
setProfileEvent(null)
|
setProfileEvent(null)
|
||||||
setNsec(null)
|
setNsec(null)
|
||||||
setFavoriteRelaysEvent(null)
|
setFavoriteRelaysEvent(null)
|
||||||
|
setFollowListEvent(null)
|
||||||
|
setMuteListEvent(null)
|
||||||
|
setBookmarkListEvent(null)
|
||||||
setNotificationsSeenAt(-1)
|
setNotificationsSeenAt(-1)
|
||||||
if (!account) {
|
if (!account) {
|
||||||
return
|
return
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue