Skip to content

Commit

Permalink
build / deploy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
michielpost committed May 25, 2024
1 parent 275fc2f commit 7c981f0
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/aoWebWallet/Pages/ScanQrPage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,15 @@
private QRCodeScannerJsInterop? _qrCodeScannerJsInterop;
private Action<string>? _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)
Expand Down

0 comments on commit 7c981f0

Please sign in to comment.