Publish Inscriboor 0.2.2 and update detection

This commit is contained in:
matcha committed 2026-10-05 05:43:15 +00:00
1 parent c9c18e85f6
commit 3445d66e1e
3 files changed
+6 -3

No files matched your search

+5 -3
View File
@@ -18,6 +18,7 @@ const THEME_KEY = 'super-testnet-theme';
let fileBytes = null, fileLoading = false, fileRevision = 0;
let lab, busy = false, reviewed = null, failed = false;
let inscriboorProvider = null;
const INSCRIBOOR_RELEASE = { version: '0.2.2', url: '/downloads/inscriboor-extension-v0.2.2.zip' };
const message = (text, error = false) => { $('status').textContent = text; $('status').classList.toggle('error', error); };
const el = (tag, text, className) => { const node = document.createElement(tag); if (text !== undefined) node.textContent = text; if (className) node.className = className; return node; };
@@ -170,8 +171,9 @@ function render() {
$('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; $('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.';
const inscriboorNeedsUpdate = !!inscriboorProvider && inscriboorProvider.version !== INSCRIBOOR_RELEASE.version;
$('connect-inscriboor').textContent = inscriboorNeedsUpdate ? 'Update Inscriboor ↓' : inscriboorProvider ? 'Connect Inscriboor ↗' : 'Get Inscriboor ↓';
$('inscriboor-status').textContent = inscriboorNeedsUpdate ? `Inscriboor ${inscriboorProvider.version ?? 'older build'} detected · ${INSCRIBOOR_RELEASE.version} available.` : inscriboorProvider ? `Inscriboor ${inscriboorProvider.version ?? ''} 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);
@@ -241,7 +243,7 @@ $('create-wallet').onclick = () => mutate(next => {
$('connect-inscriboor').onclick = async () => {
try {
const provider = inscriboorProvider ?? window.inscriboor;
if (!provider?.request) { location.href = '/downloads/inscriboor-extension-v0.2.1.zip'; return; }
if (!provider?.request || provider.version !== INSCRIBOOR_RELEASE.version) { location.href = INSCRIBOOR_RELEASE.url; 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.');