From 419ab860893a2333b2c07e8d9b512fd0dacaaa83 Mon Sep 17 00:00:00 2001 From: sairaj mote Date: Sun, 30 Jul 2023 17:39:49 +0530 Subject: [PATCH] Added warning for no support of IDB --- index.html | 141 +------------------------- scripts/components.js | 224 +++++++++++++++++++++++++++++++++++++++++- 2 files changed, 226 insertions(+), 139 deletions(-) diff --git a/index.html b/index.html index 51edb6f..fd35569 100644 --- a/index.html +++ b/index.html @@ -18,7 +18,6 @@ } - @@ -60,6 +59,8 @@ let isBrave = navigator.brave !== undefined if (error === 'Cloud offline') { document.body.prepend(document.createElement('adblocker-warning')) + } else if (error === "App database initiation failed") { + } else { notify(error, "error") } @@ -70,6 +71,7 @@ +

@@ -2336,143 +2338,6 @@ } }); } - - window.customElements.define('keys-generator', class extends HTMLElement { - constructor() { - super(); - this.innerHTML = ` - -
-
- -
- -

Keep your keys safe!

-
-

Don't share with anyone. Once lost private key can't be recovered.

-
-
-
-
-
FLO address
- -
-
-
Private key
- -
-
- -

You can use these FLO credentials with other RanchiMall apps too.

-
- ` - } - get keys() { - return { - floID: this.querySelector('#generated_flo_address').value, - privKey: this.querySelector('#generated_private_key').value - } - } - - generateKeys() { - const { floID, privKey } = floCrypto.generateNewID() - this.querySelector('#generated_flo_address').value = floID - this.querySelector('#generated_private_key').value = privKey - } - clearKeys() { - this.querySelector('#generated_flo_address').value = '' - this.querySelector('#generated_private_key').value = '' - } - }); - - const adBlockerWarning = document.createElement('template') - adBlockerWarning.innerHTML = ` - -
- `; - window.customElements.define('adblocker-warning', class extends HTMLElement { - constructor() { - super(); - this.attachShadow({ mode: 'open' }); - this.shadowRoot.appendChild(adBlockerWarning.content.cloneNode(true)); - } - connectedCallback() { - const isBrave = navigator.brave !== undefined - this.shadowRoot.querySelector('#adblocker_warning').innerHTML = ` - -

Ad-Blocker Detected!

-

- Please disable your ad-blocker for optimal experience. Our app doesn't show ads or track activity. -

- ${isBrave ? `If you have enabled Brave shield then disable it also.` : ''} - `; - } - });