Move Open in Signer button to Bunker login actions

This commit is contained in:
2026-04-11 00:28:24 +05:30
parent 3b68939572
commit ce23a67235
2 changed files with 10 additions and 12 deletions
-12
View File
@@ -1,6 +1,4 @@
<script lang="ts">
import {Capacitor} from "@capacitor/core"
import Button from "@lib/components/Button.svelte"
import Spinner from "@lib/components/Spinner.svelte"
import QRCode from "@app/components/QRCode.svelte"
import type {Nip46Controller} from "@app/util/nip46"
@@ -11,11 +9,6 @@
const {controller}: Props = $props()
const {url, loading} = controller
const isIos = Capacitor.getPlatform() === "ios"
const openSigner = () => {
controller.launchSigner()
}
</script>
{#if $url}
@@ -27,11 +20,6 @@
<div class="flex flex-col items-center gap-2">
<QRCode code={$url} />
<p class="text-sm opacity-75">Scan with your signer to log in, or click to copy.</p>
{#if isIos}
<div class="flex w-full flex-col gap-2">
<Button class="btn btn-primary" onclick={openSigner}>Open in Signer</Button>
</div>
{/if}
</div>
{/if}
{/if}
+10
View File
@@ -1,4 +1,5 @@
<script lang="ts">
import {Capacitor} from "@capacitor/core"
import {onMount, onDestroy} from "svelte"
import type {Nip46ResponseWithResult} from "@welshman/signer"
import {Nip46Broker} from "@welshman/signer"
@@ -103,10 +104,16 @@
mode = "connect"
}
const openSigner = () => {
controller.launchSigner()
}
const selectBunker = () => {
mode = "bunker"
}
const isIos = Capacitor.getPlatform() === "ios"
let mode: string = $state("bunker")
$effect(() => {
@@ -138,6 +145,9 @@
<BunkerUrl {controller} />
<Button class="btn {$bunker ? 'btn-neutral' : 'btn-primary'}" onclick={selectConnect}
>Log in with a QR code instead</Button>
{#if isIos}
<Button class="btn btn-neutral" onclick={openSigner}>Open in Signer</Button>
{/if}
{/if}
</ModalBody>
<ModalFooter>