Speed up initial load by only waiting for relays when we need them

This commit is contained in:
Jonathan Staab 2023-03-15 10:38:40 -05:00
parent 14eaec1dde
commit 9a8f6f0222
2 changed files with 5 additions and 4 deletions

View File

@ -116,9 +116,9 @@
})
onReady(() => {
initializeRelayList().then(() => {
ready = true
})
ready = true
initializeRelayList()
if (user.getProfile()) {
loadAppData(user.getPubkey())

View File

@ -72,7 +72,8 @@
})
}
if (all(isNil, Object.values(currentRelays)) && isNil(customRelayUrl)) {
// Wait for our relay list to load initially, then terminate when we've tried everything
if (allRelays.length > 0 && all(isNil, Object.values(currentRelays)) && isNil(customRelayUrl)) {
modal = "failure"
customRelayUrl = ""
}