merge upstream
This commit is contained in:
+2
-1
@@ -107,5 +107,6 @@
|
|||||||
"overrides": {
|
"overrides": {
|
||||||
"sharp": "0.35.0-rc.0"
|
"sharp": "0.35.0-rc.0"
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
|
"packageManager": "pnpm@10.33.0+sha512.10568bb4a6afb58c9eb3630da90cc9516417abebd3fabbe6739f0ae795728da1491e9db5a544c76ad8eb7570f5c4bb3d6c637b2cb41bfdcdb47fa823c8649319"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -277,7 +277,7 @@ export const joinVoiceRoom = async (
|
|||||||
try {
|
try {
|
||||||
await Promise.race([
|
await Promise.race([
|
||||||
liveKitRoom.connect(server_url, participant_token, {maxRetries: 0}),
|
liveKitRoom.connect(server_url, participant_token, {maxRetries: 0}),
|
||||||
whenTimeout(5_000, {
|
whenTimeout(15_000, {
|
||||||
message: "Connection timed out. Please check your network and try again.",
|
message: "Connection timed out. Please check your network and try again.",
|
||||||
}),
|
}),
|
||||||
whenAborted(signal),
|
whenAborted(signal),
|
||||||
|
|||||||
@@ -25,34 +25,36 @@
|
|||||||
const authError = deriveRelayAuthError(url)
|
const authError = deriveRelayAuthError(url)
|
||||||
|
|
||||||
const back = () => history.back()
|
const back = () => history.back()
|
||||||
|
|
||||||
const copyInvite = () => clip(invite)
|
const copyInvite = () => clip(invite)
|
||||||
|
|
||||||
let claim = $state("")
|
let claim = $state("")
|
||||||
let loading = $state(true)
|
let loading = $state(true)
|
||||||
|
|
||||||
let invite = $state("")
|
let invite = $state("")
|
||||||
|
|
||||||
$effect(() => {
|
$effect(() => {
|
||||||
const relay = displayRelayUrl(url)
|
const relay = displayRelayUrl(url)
|
||||||
const params = new URLSearchParams({r: relay, c: claim}).toString()
|
const params = new URLSearchParams({r: relay, c: claim}).toString()
|
||||||
|
|
||||||
invite = PLATFORM_URL + "/join?" + params
|
invite = PLATFORM_URL + "/join?" + params
|
||||||
})
|
})
|
||||||
|
|
||||||
onMount(async () => {
|
onMount(async () => {
|
||||||
const [[event]] = await Promise.all([
|
try {
|
||||||
request({
|
const [[event]] = await Promise.all([
|
||||||
relays: [url],
|
request({
|
||||||
autoClose: true,
|
relays: [url],
|
||||||
signal: AbortSignal.timeout(3000),
|
autoClose: true,
|
||||||
filters: [{kinds: [RELAY_INVITE]}],
|
signal: AbortSignal.timeout(10000),
|
||||||
}),
|
filters: [{kinds: [RELAY_INVITE]}],
|
||||||
sleep(2000),
|
}),
|
||||||
])
|
sleep(2000),
|
||||||
|
])
|
||||||
|
|
||||||
claim = getTagValue("claim", event?.tags || []) || ""
|
claim = getTagValue("claim", event?.tags || []) || ""
|
||||||
loading = false
|
} catch {
|
||||||
|
claim = ""
|
||||||
|
} finally {
|
||||||
|
loading = false
|
||||||
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|||||||
+3
-1
@@ -46,7 +46,9 @@ export const whenAborted = (signal?: AbortSignal) => {
|
|||||||
|
|
||||||
/** Returns a promise that rejects with TimeoutError after ms. Use with Promise.race. */
|
/** Returns a promise that rejects with TimeoutError after ms. Use with Promise.race. */
|
||||||
export const whenTimeout = (ms: number, opts: {message?: string} = {}) => {
|
export const whenTimeout = (ms: number, opts: {message?: string} = {}) => {
|
||||||
return new Promise<never>((_, reject) => setTimeout(() => reject(new TimeoutError()), ms))
|
return new Promise<never>((_, reject) =>
|
||||||
|
setTimeout(() => reject(new TimeoutError(opts.message)), ms),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
export const buildUrl = (base: string | URL, ...pathname: string[]) => {
|
export const buildUrl = (base: string | URL, ...pathname: string[]) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user