aboutsummaryrefslogtreecommitdiffstats
path: root/src/app.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-08-03 07:42:24 -0700
committerAdam Soltys <[email protected]>2026-08-03 07:42:24 -0700
commit161adb250e4273d0bcaa160516bc950f5f46310f (patch)
treea845b83adb75e33847f709c0d7d3e5ec3ee2ca95 /src/app.js
parent848958e450a5b5aac95a2fcd981fd229da1d6190 (diff)
downloadcoinosv3-161adb250e4273d0bcaa160516bc950f5f46310f.tar.gz
coinosv3-161adb250e4273d0bcaa160516bc950f5f46310f.zip
Self-host the punks; skipping avatar still publishes your punk
coinos.io serves 502 for a third of the punk set (both the numbered and hash endpoints), which is why a default avatar could come up blank. The 64 webps now ship with the app (53 salvaged, 11 gaps filled with donors) and every reference is same-origin. Skipping the avatar step publishes the deterministic punk as the kind-0 picture — your face is the same on every nostr client. Success screen: checkmark now sits below the title, bigger. Co-Authored-By: Claude Fable 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01Wvj4aoeMZwA7VUGdJP9Swi
Diffstat (limited to 'src/app.js')
-rw-r--r--src/app.js13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/app.js b/src/app.js
index 562ca99..36fb0d2 100644
--- a/src/app.js
+++ b/src/app.js
@@ -6,7 +6,7 @@
import { Wallet, newMnemonic, isValidMnemonic, accountXpubFor, cacheKeyFor, utxoId, parseExtendedKey, xpubToZpub, encryptVault, decryptVault } from './wallet.js';
import { qrSvg } from './qr.js';
-import { makeSearcher, resultRows, searchable } from './recipient-search.js';
+import { makeSearcher, resultRows, searchable, punkUrl } from './recipient-search.js';
import { npubOf } from './nostr.js';
import { scanQr } from './scan.js';
import { dataSources, getSource, setSource, getNetwork, setNetwork, NETWORKS } from './api.js';
@@ -2007,7 +2007,7 @@ function shouldOnboard() {
}
const PUNK_PICKS = [7, 14, 21, 3, 33, 40, 47, 36, 61, 26, 12, 50];
-const punkImg = (n) => `https://coinos.io/api/public/punks/${n}.webp`;
+const punkImg = (n) => `punks/${n}.webp`;
async function onbUpload(file) {
const fd = new FormData();
@@ -2110,7 +2110,10 @@ function onboardScreen() {
ui.onbBusy = true; ui.onbError = ''; render();
try {
const addr = featureHook('namesAddress');
- const fields = { name: addr ? addr.split('@')[0] : undefined, picture: o.avatar || undefined };
+ // keeping the default still publishes it — their punk should be
+ // their face on every nostr client, not just here
+ const picture = o.avatar || (me ? 'https://v3.coinos.io/' + punkUrl(me) : undefined);
+ const fields = { name: addr ? addr.split('@')[0] : undefined, picture };
if (fields.name || fields.picture) await featureHook('publishProfile', fields);
o.step = 'success';
} catch (e) { ui.onbError = e.message; }
@@ -2121,8 +2124,8 @@ function onboardScreen() {
// success
return page([
h('div', { class: 'onb-confetti' }, ...Array.from({ length: 18 }, () => h('i'))),
- h('div', { class: 'check-badge', style: 'align-self:center' }, '✓'),
- title(t('onbDoneTitle')),
+ h('h2', { class: 'onb-title', style: 'text-align:center' }, t('onbDoneTitle')),
+ h('div', { class: 'check-badge onb-check' }, '✓'),
h('p', { class: 'muted', style: 'margin:0;text-align:center' }, t('onbDoneBody')),
h('button', { class: 'btn-primary btn-block', style: 'padding:14px', onClick: () => {
try { localStorage.setItem(ONBOARDED_KEY, '1'); } catch {}