feat(ui): show single iOS signer action
This commit is contained in:
@@ -11,13 +11,10 @@
|
|||||||
|
|
||||||
const {controller}: Props = $props()
|
const {controller}: Props = $props()
|
||||||
const {url, loading} = controller
|
const {url, loading} = controller
|
||||||
|
const isIos = Capacitor.getPlatform() === "ios"
|
||||||
|
|
||||||
const openAegis = () => {
|
const openSigner = () => {
|
||||||
controller.launchSigner("aegis")
|
controller.launchSigner()
|
||||||
}
|
|
||||||
|
|
||||||
const openNostrSigner = () => {
|
|
||||||
controller.launchSigner("nostrsigner")
|
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
@@ -30,10 +27,9 @@
|
|||||||
<div class="flex flex-col items-center gap-2">
|
<div class="flex flex-col items-center gap-2">
|
||||||
<QRCode code={$url} />
|
<QRCode code={$url} />
|
||||||
<p class="text-sm opacity-75">Scan with your signer to log in, or click to copy.</p>
|
<p class="text-sm opacity-75">Scan with your signer to log in, or click to copy.</p>
|
||||||
{#if Capacitor.isNativePlatform()}
|
{#if isIos}
|
||||||
<div class="flex w-full flex-col gap-2">
|
<div class="flex w-full flex-col gap-2">
|
||||||
<Button class="btn btn-primary" onclick={openAegis}>Open in Aegis</Button>
|
<Button class="btn btn-primary" onclick={openSigner}>Open in Signer</Button>
|
||||||
<Button class="btn" onclick={openNostrSigner}>Open in Nostr Signer</Button>
|
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -13,8 +13,6 @@ import {pushToast} from "@app/util/toast"
|
|||||||
|
|
||||||
const APP_SCHEME = "social.flotilla"
|
const APP_SCHEME = "social.flotilla"
|
||||||
|
|
||||||
type NostrSignerScheme = "aegis" | "nostrsigner"
|
|
||||||
|
|
||||||
const makeSignerCallbackUrl = (path: string) => `${APP_SCHEME}://x-callback-url/${path}`
|
const makeSignerCallbackUrl = (path: string) => `${APP_SCHEME}://x-callback-url/${path}`
|
||||||
|
|
||||||
const makeSignerLaunchUrl = (nostrconnectUrl: string) => {
|
const makeSignerLaunchUrl = (nostrconnectUrl: string) => {
|
||||||
@@ -72,7 +70,7 @@ export class Nip46Controller {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
launchSigner(_scheme?: NostrSignerScheme) {
|
launchSigner() {
|
||||||
const nostrconnectUrl = get(this.url)
|
const nostrconnectUrl = get(this.url)
|
||||||
const signerUrl = nostrconnectUrl && makeSignerLaunchUrl(nostrconnectUrl)
|
const signerUrl = nostrconnectUrl && makeSignerLaunchUrl(nostrconnectUrl)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user