Fix Inscriboor detection flow
This commit is contained in:
1 parent
84f684ad0d
commit
c9c18e85f6
3 files changed
+5
-4
No files matched your search
+4
-3
@@ -169,8 +169,9 @@ function render() {
|
||||
const disabled = busy || failed;
|
||||
$('empty-wallet').hidden = !!wallet; $('active-wallet').hidden = !wallet;
|
||||
$('wallet-state').textContent = wallet ? (wallet.kind === 'extension-wallet' ? 'INSCRIBOOR / TEST' : 'LOCAL / TEST ONLY') : 'NOT CREATED';
|
||||
$('create-wallet').disabled = disabled; $('connect-inscriboor').disabled = disabled || !inscriboorProvider; $('load-wallet').disabled = disabled;
|
||||
$('inscriboor-status').textContent = inscriboorProvider ? 'Inscriboor detected - extension key stays outside this page.' : 'Inscriboor not detected. Reload the extension or use the local test wallet.';
|
||||
$('create-wallet').disabled = disabled; $('connect-inscriboor').disabled = disabled; $('load-wallet').disabled = disabled;
|
||||
$('connect-inscriboor').textContent = inscriboorProvider ? 'Connect Inscriboor ↗' : 'Get Inscriboor ↓';
|
||||
$('inscriboor-status').textContent = inscriboorProvider ? 'Inscriboor detected - extension key stays outside this page.' : 'Inscriboor not detected. Install it, refresh, then connect.';
|
||||
$('mine').disabled = disabled || !wallet;
|
||||
$('miner-interval').disabled = disabled || !wallet;
|
||||
$('miner-interval').value = String(lab?.miner?.interval ?? 0);
|
||||
@@ -240,7 +241,7 @@ $('create-wallet').onclick = () => mutate(next => {
|
||||
$('connect-inscriboor').onclick = async () => {
|
||||
try {
|
||||
const provider = inscriboorProvider ?? window.inscriboor;
|
||||
if (!provider?.request) throw new Error('Inscriboor extension not detected.');
|
||||
if (!provider?.request) { location.href = '/downloads/inscriboor-extension-v0.2.1.zip'; return; }
|
||||
const account = (await provider.request({ method:'bitcoin_getAccounts' }))?.[0];
|
||||
await mutate(next => {
|
||||
if (next.wallet) throw new Error('A wallet already exists in this browser. Reset or restore a different lab first.');
|
||||
|
||||
Reference in new issue
Block a user