Normalize relay URLs

This commit is contained in:
Jon Staab
2026-01-08 12:08:13 -08:00
parent cd1b328b1b
commit f86afc08fa
7 changed files with 30 additions and 20 deletions
+2 -1
View File
@@ -99,7 +99,8 @@
{/snippet}
</FieldInline>
<p class="text-sm">
Forgot your password? <Button class="link" onclick={loginWithOTP}>Log in with a one-time access code</Button
Forgot your password? <Button class="link" onclick={loginWithOTP}
>Log in with a one-time access code</Button
>.
</p>
<ModalFooter>
+2 -2
View File
@@ -111,8 +111,8 @@
{/snippet}
</FieldInline>
<p class="text-sm">
To keep your key as safe a possible, you will receive <strong>three separate emails</strong>.
Be sure to enter all three codes!
To keep your key as safe a possible, you will receive <strong>three separate emails</strong>. Be
sure to enter all three codes!
</p>
<ModalFooter>
<Button class="btn btn-link" onclick={back} disabled={loading}>
+3 -2
View File
@@ -1,5 +1,5 @@
<script lang="ts">
import {loadProfile} from "@welshman/app"
import {getProfile, loadProfile} from "@welshman/app"
import ProfileCircle from "@app/components/ProfileCircle.svelte"
type Props = {
@@ -22,7 +22,8 @@
<div class="flex pr-3">
{#each visiblePubkeys.toSorted().slice(0, 15) as pubkey (pubkey)}
<div class="z-feature -mr-3 inline-block flex items-center justify-center bg-base-100 rounded-full h-8 w-8">
<div
class="z-feature -mr-3 inline-block flex h-8 w-8 items-center justify-center rounded-full bg-base-100">
<ProfileCircle class="h-8 w-8 bg-base-300" {pubkey} {size} />
</div>
{/each}
+4 -4
View File
@@ -28,10 +28,10 @@
const onSubmit = async () => {
if (password.trim().length < 12) {
return pushToast({
theme: "error",
message: "Password must be at least 12 characters long.",
})
return pushToast({
theme: "error",
message: "Password must be at least 12 characters long.",
})
}
loading = true
+2 -1
View File
@@ -68,7 +68,8 @@
{/snippet}
</FieldInline>
<p class="text-sm">
We just sent a one-time confirmation code to {email}. Once you receive it, you can enter it above.
We just sent a one-time confirmation code to {email}. Once you receive it, you can enter it
above.
</p>
<ModalFooter>
<Button class="btn btn-link" onclick={back} disabled={loading}>
+9 -9
View File
@@ -138,13 +138,15 @@ export const ENABLE_ZAPS = Capacitor.getPlatform() != "ios"
export const NOTIFIER_PUBKEY = import.meta.env.VITE_NOTIFIER_PUBKEY
export const NOTIFIER_RELAY = import.meta.env.VITE_NOTIFIER_RELAY
export const VAPID_PUBLIC_KEY = import.meta.env.VITE_VAPID_PUBLIC_KEY
export const INDEXER_RELAYS = fromCsv(import.meta.env.VITE_INDEXER_RELAYS)
export const NOTIFIER_RELAY = normalizeRelayUrl(import.meta.env.VITE_NOTIFIER_RELAY)
export const SIGNER_RELAYS = fromCsv(import.meta.env.VITE_SIGNER_RELAYS)
export const SIGNER_RELAYS = fromCsv(import.meta.env.VITE_SIGNER_RELAYS).map(normalizeRelayUrl)
export const INDEXER_RELAYS = fromCsv(import.meta.env.VITE_INDEXER_RELAYS).map(normalizeRelayUrl)
export const PLATFORM_RELAYS = fromCsv(import.meta.env.VITE_PLATFORM_RELAYS).map(normalizeRelayUrl)
export const PLATFORM_URL = import.meta.env.VITE_PLATFORM_URL
@@ -156,16 +158,14 @@ export const PLATFORM_LOGO = PLATFORM_URL + "/logo.png"
export const PLATFORM_NAME = import.meta.env.VITE_PLATFORM_NAME
export const PLATFORM_RELAYS = fromCsv(import.meta.env.VITE_PLATFORM_RELAYS)
export const PLATFORM_ACCENT = import.meta.env.VITE_PLATFORM_ACCENT
export const PLATFORM_DESCRIPTION = import.meta.env.VITE_PLATFORM_DESCRIPTION
export const DEFAULT_BLOSSOM_SERVERS = fromCsv(import.meta.env.VITE_DEFAULT_BLOSSOM_SERVERS)
export const POMADE_SIGNERS = fromCsv(import.meta.env.VITE_POMADE_SIGNERS)
export const DEFAULT_BLOSSOM_SERVERS = fromCsv(import.meta.env.VITE_DEFAULT_BLOSSOM_SERVERS)
export const DEFAULT_PUBKEYS = import.meta.env.VITE_DEFAULT_PUBKEYS
export const DUFFLEPUD_URL = "https://dufflepud.onrender.com"
@@ -236,7 +236,7 @@ export const deriveRelaySignedEvents = (url: string, filters: Filter[]) =>
pomadeContext.setSignerPubkeys(POMADE_SIGNERS)
pomadeContext.setArgonWorker(import('@pomade/core/argon-worker.js?worker'))
pomadeContext.setArgonWorker(import("@pomade/core/argon-worker.js?worker"))
appContext.dufflepudUrl = DUFFLEPUD_URL
+8 -1
View File
@@ -2,7 +2,13 @@ import {writable} from "svelte/store"
import type {Nip46ResponseWithResult} from "@welshman/signer"
import {Nip46Broker} from "@welshman/signer"
import {makeSecret} from "@welshman/util"
import {PLATFORM_URL, PLATFORM_NAME, PLATFORM_LOGO, SIGNER_RELAYS} from "@app/core/state"
import {
PLATFORM_URL,
PLATFORM_NAME,
PLATFORM_LOGO,
SIGNER_RELAYS,
NIP46_PERMS,
} from "@app/core/state"
import {pushToast} from "@app/util/toast"
export class Nip46Controller {
@@ -23,6 +29,7 @@ export class Nip46Controller {
url: PLATFORM_URL,
name: PLATFORM_NAME,
image: PLATFORM_LOGO,
perms: NIP46_PERMS,
})
this.url.set(url)