diff options
| author | Adam Soltys <[email protected]> | 2026-10-01 16:34:55 -0700 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2026-10-01 16:34:55 -0700 |
| commit | 66d41d1aa1f5c60cd63b1691ba6bf70e88cf78fa (patch) | |
| tree | b26348dfe27873e9bd610b67a5880de00cf3db72 /src/app.js | |
| parent | a7806172f7ede9be345750c93e5fa72e10e9b953 (diff) | |
| download | coinosv3-66d41d1aa1f5c60cd63b1691ba6bf70e88cf78fa.tar.gz coinosv3-66d41d1aa1f5c60cd63b1691ba6bf70e88cf78fa.zip | |
The standalone wallet opened from a disk shows its avatars, font and languages.
With no files beside it, relative punks/, locales/, nip46.js and jsqr.js
looked on the disk. From file:// they now come from v3.coinos.io (images
and scripts need no CORS; /locales/ now sends Access-Control-Allow-Origin
on the server), and standalone.html carries Public Sans inline.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01VP5Ljqk7EYcm5QQAbzDwog
Diffstat (limited to 'src/app.js')
| -rw-r--r-- | src/app.js | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -8,6 +8,7 @@ import { Wallet, newMnemonic, isValidMnemonic, accountXpubFor, cacheKeyFor, utxo import { qrSvg } from './qr.js'; import './rich-text.js'; // <coinos-text>, the composers' field import { makeSearcher, resultRows, searchable, punkUrl, warmSearch } from './recipient-search.js'; +import { assetUrl } from './asset-url.js'; import { npubOf, seedPubkey, neventOf } from './nostr.js'; import { nip98Header } from './nip98.js'; import { uploadPublicMedia, MediaUploadError } from './media-upload.js'; @@ -3467,7 +3468,7 @@ const PUNK_PICKS = [7, 14, 21, 3, 33, 40, 47, 36, 61, 26, 12, 50]; // becomes this person's picture on every nostr client. The tiles in the // picker are 56px, so they load the small copies. const punkImg = (n) => `punks/${n}.webp`; -const punkTile = (n) => `punks-sm/${n}.webp`; +const punkTile = (n) => assetUrl(`punks-sm/${n}.webp`); async function onbUpload(file) { const fd = new FormData(); @@ -3752,7 +3753,7 @@ function onboardScreen() { title(t('onbAvatarTitle')), h('p', { class: 'muted', style: 'margin:0' }, t('onbAvatarBody')), preview ? h('img', { - class: 'onb-avatar', src: preview, alt: '', + class: 'onb-avatar', src: /^(https?|data|blob):/i.test(preview) ? preview : assetUrl(preview), alt: '', style: ui.onbBusy ? 'opacity:.5' : '', onError: (e) => { e.target.style.visibility = 'hidden'; }, }) : null, |
