diff --git a/src/main.ts b/src/main.ts index 7b12edf..f151f39 100644 --- a/src/main.ts +++ b/src/main.ts @@ -212,7 +212,11 @@ export const connect = async ({ modal.$destroy() } } catch (error) { - modal.$set({ layout: Layout.failure }) + if ( + [Layout.connecting, Layout.qrCode].includes(modal.getLayout()) + ) { + modal.$set({ layout: Layout.failure }) + } reject(error) } }, diff --git a/src/modal/Modal.d.ts b/src/modal/Modal.d.ts index 691379d..0252472 100644 --- a/src/modal/Modal.d.ts +++ b/src/modal/Modal.d.ts @@ -22,4 +22,5 @@ interface ModalProps { interface ModalInstance extends SvelteComponent { $set(props: Partial): void $destroy(): void + getLayout: () => Layout } diff --git a/src/modal/Modal.svelte b/src/modal/Modal.svelte index a40dfcd..dbeb81f 100644 --- a/src/modal/Modal.svelte +++ b/src/modal/Modal.svelte @@ -27,6 +27,9 @@ function setLayout(newLayout: Layout): void { layout = newLayout } + export function getLayout() { + return layout + } export let modalWallets: ModalWallet[] = [] export let selectedWallet: ModalWallet | null = null