From 7c981f05a18c991606ff59eb1a24f6ff12bdf664 Mon Sep 17 00:00:00 2001 From: Michiel Post Date: Sat, 25 May 2024 14:25:13 +0200 Subject: [PATCH] build / deploy fix --- src/aoWebWallet/Pages/ScanQrPage.razor | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/aoWebWallet/Pages/ScanQrPage.razor b/src/aoWebWallet/Pages/ScanQrPage.razor index 2f4a383..c33a8cb 100644 --- a/src/aoWebWallet/Pages/ScanQrPage.razor +++ b/src/aoWebWallet/Pages/ScanQrPage.razor @@ -25,12 +25,15 @@ private QRCodeScannerJsInterop? _qrCodeScannerJsInterop; private Action? _onQrCodeScanAction; - protected override async Task OnInitializedAsync() + protected override async Task OnAfterRenderAsync(bool firstRender) { - _onQrCodeScanAction = (code) => OnQrCodeScan(code); + if (firstRender) + { + _onQrCodeScanAction = (code) => OnQrCodeScan(code); - _qrCodeScannerJsInterop = new QRCodeScannerJsInterop(JS); - await _qrCodeScannerJsInterop.Init(_onQrCodeScanAction); + _qrCodeScannerJsInterop = new QRCodeScannerJsInterop(JS); + await _qrCodeScannerJsInterop.Init(_onQrCodeScanAction); + } } private void OnQrCodeScan(string code)