mirror of
https://github.com/coracle-social/flotilla.git
synced 2025-12-10 10:57:04 +00:00
Tweak connection errors
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import {get} from "svelte/store"
|
||||
import {ctx, sample, uniq, sleep, chunk, equals, choice} from "@welshman/lib"
|
||||
import {ctx, sample, uniq, sleep, chunk, equals} from "@welshman/lib"
|
||||
import {
|
||||
DELETE,
|
||||
PROFILE,
|
||||
@@ -85,19 +85,6 @@ export const getPubkeyPetname = (pubkey: string) => {
|
||||
return display
|
||||
}
|
||||
|
||||
export const makeMention = (pubkey: string, hints?: string[]) => [
|
||||
"p",
|
||||
pubkey,
|
||||
choice(hints || getPubkeyHints(pubkey)),
|
||||
getPubkeyPetname(pubkey),
|
||||
]
|
||||
|
||||
export const makeIMeta = (url: string, data: Record<string, string>) => [
|
||||
"imeta",
|
||||
`url ${url}`,
|
||||
...Object.entries(data).map(([k, v]) => [k, v].join(" ")),
|
||||
]
|
||||
|
||||
export const getThunkError = async (thunk: Thunk) => {
|
||||
const result = await thunk.result
|
||||
const [{status, message}] = Object.values(result) as any
|
||||
@@ -342,7 +329,7 @@ export const checkRelayAccess = async (url: string, claim = "") => {
|
||||
|
||||
const result = await thunk.result
|
||||
|
||||
if (result[url].status !== PublishStatus.Success) {
|
||||
if (result[url].status === PublishStatus.Failure) {
|
||||
const message =
|
||||
connection.auth.message?.replace(/^.*: /, "") ||
|
||||
result[url].message?.replace(/^.*: /, "") ||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<script lang="ts">
|
||||
import {displayRelayUrl} from "@welshman/util"
|
||||
import Spinner from "@lib/components/Spinner.svelte"
|
||||
import Button from "@lib/components/Button.svelte"
|
||||
import Field from "@lib/components/Field.svelte"
|
||||
@@ -47,7 +48,9 @@
|
||||
<div slot="title">Access Error</div>
|
||||
<div slot="info">We couldn't connect you to this space.</div>
|
||||
</ModalHeader>
|
||||
<p>We received an error from the relay indicating you don't have access to this space.</p>
|
||||
<p>
|
||||
We received an error from the relay indicating you don't have access to {displayRelayUrl(url)}.
|
||||
</p>
|
||||
<p class="border-l border-solid border-error pl-4 text-error">
|
||||
{error}
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user