From e26d9fe3b875944190d629cbf0da14ce954b3793 Mon Sep 17 00:00:00 2001 From: spwoodcock Date: Mon, 9 Dec 2024 23:09:47 +0000 Subject: [PATCH] fix(mapper): correctly inject username into qrcode from logged in details --- src/mapper/src/lib/components/qrcode.svelte | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mapper/src/lib/components/qrcode.svelte b/src/mapper/src/lib/components/qrcode.svelte index 0db6db2a1..e10566a74 100644 --- a/src/mapper/src/lib/components/qrcode.svelte +++ b/src/mapper/src/lib/components/qrcode.svelte @@ -2,6 +2,7 @@ import type { Snippet } from 'svelte'; import SlDialog from '@shoelace-style/shoelace/dist/components/dialog/dialog.component.js'; + import { getLoginStore } from '$store/login.svelte.ts'; import { generateQrCode, downloadQrCode } from '$lib/odk/qrcode'; interface Props { @@ -13,7 +14,9 @@ let { infoDialogRef, projectName, projectOdkToken, children }: Props = $props(); - let qrCodeData = $derived(generateQrCode(projectName, projectOdkToken, 'REPLACE_ME_WITH_A_USERNAME')); + const loginStore = getLoginStore(); + + let qrCodeData = $derived(generateQrCode(projectName, projectOdkToken, loginStore.getAuthDetails?.username || 'fmtm user'));