Optimistically load messaging relays

This commit is contained in:
Jon Staab
2026-02-09 16:57:44 -08:00
parent bb15c9e2d0
commit f80aba33f1
3 changed files with 27 additions and 9 deletions
+10 -8
View File
@@ -48,7 +48,7 @@
import ChatCompose from "@app/components/ChatCompose.svelte"
import ChatComposeParent from "@app/components/ChatComposeParent.svelte"
import ThunkToast from "@app/components/ThunkToast.svelte"
import {INDEXER_RELAYS, userSettingsValues, PLATFORM_NAME, deriveChat} from "@app/core/state"
import {userSettingsValues, PLATFORM_NAME, deriveChat} from "@app/core/state"
import {pushModal} from "@app/util/modal"
import {prependParent} from "@app/core/commands"
import {pushToast} from "@app/util/toast"
@@ -121,12 +121,14 @@
// Split the message into multiple pieces so that we can use kind 15 to send images per nip 17
// Sleep 1 second between each one to make sure timestamps are distinct
const thunks = Array.from(enumerate(templates)).map(([i, event]) =>
sendWrapped({
event,
recipients: pubkeys,
delay: $userSettingsValues.send_delay + ms(i),
}),
const thunks = await Promise.all(
Array.from(enumerate(templates)).map(([i, event]) =>
sendWrapped({
event,
recipients: pubkeys,
delay: $userSettingsValues.send_delay + ms(i),
}),
),
)
pushToast({
@@ -178,7 +180,7 @@
onMount(() => {
for (const pubkey of others) {
loadMessagingRelayList(pubkey, INDEXER_RELAYS, true)
loadMessagingRelayList(pubkey)
}
const observer = new ResizeObserver(() => {