Fix initial profile/relays load
This commit is contained in:
parent
f2b13c6ab9
commit
4d517798ad
1 changed files with 16 additions and 13 deletions
|
|
@ -29,7 +29,7 @@ import {
|
||||||
unionFilters,
|
unionFilters,
|
||||||
} from "@welshman/util"
|
} from "@welshman/util"
|
||||||
import type {Filter} from "@welshman/util"
|
import type {Filter} from "@welshman/util"
|
||||||
import type {FollowListReader, RelayListReader, RoomListReader} from "@welshman/domain"
|
import type {FollowListReader, RoomListReader} from "@welshman/domain"
|
||||||
import {merged, synced, withGetter} from "@welshman/store"
|
import {merged, synced, withGetter} from "@welshman/store"
|
||||||
import {
|
import {
|
||||||
FollowLists,
|
FollowLists,
|
||||||
|
|
@ -171,6 +171,7 @@ const syncUserRoomMembership = (url: string, h: string) => {
|
||||||
|
|
||||||
const syncUserData = () => {
|
const syncUserData = () => {
|
||||||
const unsubscribersByKey = new Map<string, Unsubscriber>()
|
const unsubscribersByKey = new Map<string, Unsubscriber>()
|
||||||
|
const $pubkey = app.get().user?.pubkey
|
||||||
|
|
||||||
const syncRoomList = ($roomList: Maybe<RoomListReader>) => {
|
const syncRoomList = ($roomList: Maybe<RoomListReader>) => {
|
||||||
if ($roomList) {
|
if ($roomList) {
|
||||||
|
|
@ -203,17 +204,15 @@ const syncUserData = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const syncRelayList = ($relayList: Maybe<RelayListReader>) => {
|
const syncUserLists = () => {
|
||||||
const author = $relayList?.author()
|
if ($pubkey) {
|
||||||
|
blossomServerLists.get().load($pubkey)
|
||||||
if (author) {
|
blockedRelayLists.get().load($pubkey)
|
||||||
blossomServerLists.get().load(author)
|
followLists.get().load($pubkey)
|
||||||
blockedRelayLists.get().load(author)
|
roomLists.get().load($pubkey)
|
||||||
followLists.get().load(author)
|
muteLists.get().load($pubkey)
|
||||||
roomLists.get().load(author)
|
profiles.get().load($pubkey)
|
||||||
muteLists.get().load(author)
|
app.get().use(Settings).load($pubkey)
|
||||||
profiles.get().load(author)
|
|
||||||
app.get().use(Settings).load(author)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -230,8 +229,12 @@ const syncUserData = () => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($pubkey) {
|
||||||
|
relayLists.get().load($pubkey)
|
||||||
|
}
|
||||||
|
|
||||||
const unsubscribeRoomList = userRoomList.subscribe(syncRoomList)
|
const unsubscribeRoomList = userRoomList.subscribe(syncRoomList)
|
||||||
const unsubscribeRelayList = userRelayList.subscribe(syncRelayList)
|
const unsubscribeRelayList = userRelayList.subscribe(syncUserLists)
|
||||||
const unsubscribeFollowList = userFollowList.subscribe(syncFollowNetwork)
|
const unsubscribeFollowList = userFollowList.subscribe(syncFollowNetwork)
|
||||||
|
|
||||||
return () => {
|
return () => {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue