Skip to content

Commit a96046f

Browse files
fix: open Yivi app on mobile decrypt page instead of QR
The /decrypt fallback page rendered a QR code on mobile, which is useless when the user is already on their phone. Mirror the /download page's pattern: detect mobile and pass mode=deeplink to YiviQRCode so it auto-clicks the Yivi-app button and triggers the universal link. Closes #163
1 parent ddd1d35 commit a96046f

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

src/lib/components/fallback/Decrypt.svelte

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
1515
import YiviQRCode from '$lib/components/filesharing/YiviQRCode.svelte'
1616
import Chip from '$lib/components/Chip.svelte'
17+
import { isMobile } from '$lib/browser-detect'
1718
1819
const STATES = {
1920
Uninit: 'Uninit',
@@ -26,6 +27,7 @@
2627
}
2728
2829
let decryptState = $state(STATES.Uninit)
30+
const isMobileDevice = isMobile()
2931
3032
let policies = $state()
3133
let keylist = $state()
@@ -304,7 +306,11 @@
304306
{/each}
305307
</div>
306308
{/if}
307-
<YiviQRCode id="yivi-fallback" responsive />
309+
<YiviQRCode
310+
id="yivi-fallback"
311+
responsive
312+
mode={isMobileDevice ? 'deeplink' : 'qr'}
313+
/>
308314
</div>
309315
{:else if decryptState === STATES.Decrypting}
310316
<div class="spinner-wrapper">

0 commit comments

Comments
 (0)