Skip to content

Commit

Permalink
feat: Optionally suppress wallet
Browse files Browse the repository at this point in the history
Enables and optional URL argument to suppress rendering
the wallet to just show the REPL for demos. Add `w=0` to suppress
the wallet rendering
  • Loading branch information
dtribble committed May 7, 2020
1 parent a37715f commit ceae9e6
Showing 1 changed file with 14 additions and 11 deletions.
25 changes: 14 additions & 11 deletions packages/cosmic-swingset/lib/ag-solo/html/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,17 +273,20 @@ const fpj = fetch('/package.json')
});
fetches.push(fpj);

fetch('wallet/')
.then(resp => {
if (resp.status < 200 || resp.status >= 300) {
throw Error(`status ${resp.status}`);
}
walletFrame.style.display = 'block';
walletFrame.src = 'wallet/';
})
.catch(e => {
console.log('Cannot fetch wallet/', e);
});
// an optional `w=0` GET argument will suppress showing the wallet
if (new URLSearchParams(window.location.search).get('w') !== '0') {
fetch('wallet/')
.then(resp => {
if (resp.status < 200 || resp.status >= 300) {
throw Error(`status ${resp.status}`);
}
walletFrame.style.display = 'block';
walletFrame.src = 'wallet/';
})
.catch(e => {
console.log('Cannot fetch wallet/', e);
});
}

Promise.all(fetches)
.then(([rev, pjson]) => {
Expand Down

0 comments on commit ceae9e6

Please sign in to comment.