]> zoso.dev Git - nemo-wallet.git/commitdiff
Enable QR code test during page load.
authorChris Duncan <chris@zoso.dev>
Sun, 3 Nov 2024 02:44:39 +0000 (19:44 -0700)
committerChris Duncan <chris@zoso.dev>
Sun, 3 Nov 2024 02:44:39 +0000 (19:44 -0700)
nemo-wallet.html

index c9e62a50d00183781a7b7d5eb9dffea5160f326e..6f295c60d8fa938e9385eae08066f152f4040e3b 100644 (file)
        </script>
        <script type="module" src="https://cdn.jsdelivr.net/npm/libnemo@0.0.18/dist/global.min.js"></script>
        <script>
-               // const barcodeDetector = new BarcodeDetector({
-               //      formats: ["qr_code"],
-               // })
-               // const imageFile = await fetch(
-               //      "https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=Hello%20world!",
-               // ).then(resp => resp.blob())
-               // barcodeDetector.detect(imageFile).then(console.log)
 
                // let css
                const observer = new MutationObserver((mutations) => {
                        } catch (err) {
                                location.hash = '#transact'
                        }
+                       await loadQr()
                        await loadData()
                        await loadUi()
                        console.log('done')
                })
 
+               async function loadQr () {
+                       const barcodeDetector = new BarcodeDetector({
+                               formats: ["qr_code"],
+                       })
+                       const imageFile = await fetch(
+                               "https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=Hello%20world!",
+                       ).then(resp => resp.blob())
+                       barcodeDetector.detect(imageFile).then(console.log)
+               }
+
                async function loadData () {
                        console.log('loading data')
                        const walletSelect = document.querySelector('#wallet')