forked from coracle/flotilla
Fix conversation sync
This commit is contained in:
+6
-5
@@ -283,7 +283,7 @@ export const checkRelayAccess = async (url: string, claim = "") => {
|
||||
result[url].message?.replace(/^.*: /, "") ||
|
||||
"join request rejected"
|
||||
|
||||
return `Failed to join relay: ${message}`
|
||||
return `Failed to join relay (${message})`
|
||||
}
|
||||
}
|
||||
|
||||
@@ -309,11 +309,12 @@ export const checkRelayAuth = async (url: string) => {
|
||||
const connection = ctx.net.pool.get(url)
|
||||
const okStatuses = [AuthStatus.None, AuthStatus.Ok]
|
||||
|
||||
await connection.auth.attempt(5000)
|
||||
await connection.auth.attempt(30_000)
|
||||
|
||||
if (!okStatuses.includes(connection.auth.status)) {
|
||||
console.log(connection.auth.status, connection)
|
||||
return `Failed to authenticate: "${connection.auth.message}"`
|
||||
// Only raise an error if it's not a timeout.
|
||||
// If it is, odds are the problem is with our signer, not the relay
|
||||
if (!okStatuses.includes(connection.auth.status) && connection.auth.message) {
|
||||
return `Failed to authenticate (${connection.auth.message})`
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,12 +1,10 @@
|
||||
<script lang="ts">
|
||||
import {onMount} from "svelte"
|
||||
import {derived} from "svelte/store"
|
||||
import {page} from "$app/stores"
|
||||
import {remove} from "@welshman/lib"
|
||||
import type {TrustedEvent} from "@welshman/util"
|
||||
import {pubkey, inboxRelaySelectionsByPubkey, loadInboxRelaySelections} from "@welshman/app"
|
||||
import {pubkey, loadInboxRelaySelections} from "@welshman/app"
|
||||
import Link from "@lib/components/Link.svelte"
|
||||
import Icon from "@lib/components/Icon.svelte"
|
||||
import ProfileName from "@app/components/ProfileName.svelte"
|
||||
import ProfileCircle from "@app/components/ProfileCircle.svelte"
|
||||
import ProfileCircles from "@app/components/ProfileCircles.svelte"
|
||||
@@ -19,7 +17,6 @@
|
||||
const message = messages[0]
|
||||
const others = remove($pubkey!, pubkeys)
|
||||
const active = $page.params.chat === id
|
||||
const missingInbox = derived(inboxRelaySelectionsByPubkey, $m => others.some(pk => !$m.has(pk)))
|
||||
|
||||
onMount(() => {
|
||||
for (const pk of others) {
|
||||
@@ -47,9 +44,6 @@
|
||||
</p>
|
||||
{/if}
|
||||
</div>
|
||||
{#if $missingInbox}
|
||||
<Icon icon="danger" class="text-error" />
|
||||
{/if}
|
||||
</div>
|
||||
<p class="overflow-hidden text-ellipsis whitespace-nowrap text-sm">
|
||||
{message.content}
|
||||
|
||||
@@ -88,13 +88,21 @@
|
||||
</p>
|
||||
{#if getNip07()}
|
||||
<Button disabled={loading} on:click={loginWithNip07} class="btn btn-primary">
|
||||
<Icon icon="widget" />
|
||||
{#if loading}
|
||||
<span class="loading loading-spinner mr-3" />
|
||||
{:else}
|
||||
<Icon icon="widget" />
|
||||
{/if}
|
||||
Log in with Extension
|
||||
</Button>
|
||||
{/if}
|
||||
{#each signers as app}
|
||||
<Button disabled={loading} class="btn btn-neutral" on:click={() => loginWithSigner(app)}>
|
||||
<img src={app.iconUrl} alt={app.name} width="48" height="48" />
|
||||
{#if loading}
|
||||
<span class="loading loading-spinner mr-3" />
|
||||
{:else}
|
||||
<img src={app.iconUrl} alt={app.name} width="48" height="48" />
|
||||
{/if}
|
||||
Log in with {app.name}
|
||||
</Button>
|
||||
{/each}
|
||||
@@ -107,6 +115,7 @@
|
||||
</Button>
|
||||
<Link
|
||||
external
|
||||
disabled={loading}
|
||||
href="https://nostrapps.com#signers"
|
||||
class="btn {hasNativeSigner ? '' : 'btn-neutral'}">
|
||||
<Icon icon="compass" />
|
||||
|
||||
@@ -26,8 +26,9 @@
|
||||
|
||||
<form class="column gap-4" on:submit|preventDefault={logout}>
|
||||
<ModalHeader>
|
||||
<div slot="title">Are you sure you want to log out?</div>
|
||||
<div slot="title">Are you sure you<br />want to log out?</div>
|
||||
</ModalHeader>
|
||||
<p>Your local database will be cleared.</p>
|
||||
<ModalFooter>
|
||||
<Button class="btn btn-link" on:click={back}>
|
||||
<Icon icon="alt-arrow-left" />
|
||||
|
||||
Reference in New Issue
Block a user