aboutsummaryrefslogtreecommitdiffstats
path: root/src/nostr-login.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2026-10-01 16:34:55 -0700
committerAdam Soltys <[email protected]>2026-10-01 16:34:55 -0700
commit66d41d1aa1f5c60cd63b1691ba6bf70e88cf78fa (patch)
treeb26348dfe27873e9bd610b67a5880de00cf3db72 /src/nostr-login.js
parenta7806172f7ede9be345750c93e5fa72e10e9b953 (diff)
downloadcoinosv3-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/nostr-login.js')
-rw-r--r--src/nostr-login.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/nostr-login.js b/src/nostr-login.js
index d6cb978..fe60261 100644
--- a/src/nostr-login.js
+++ b/src/nostr-login.js
@@ -40,6 +40,7 @@ import { getPublicKey, finalizeEvent, nip44 } from './nostr.js';
import { SimplePool } from 'nostr-tools/pool';
import { generateSecretKey } from 'nostr-tools/pure';
import { decode as nip19decode } from 'nostr-tools/nip19';
+import { assetUrl } from './asset-url.js';
// NIP-46 loads lazily from dist/nip46.js (same pattern as the QR decoder):
// bunker logins are rare, and the module is heavy. Tests running outside a
@@ -50,7 +51,7 @@ function loadNip46() {
if (typeof globalThis !== 'undefined' && globalThis.__nip46) return (_nip46 = Promise.resolve(globalThis.__nip46));
_nip46 = new Promise((resolve, reject) => {
const s = document.createElement('script');
- s.src = 'nip46.js';
+ s.src = assetUrl('nip46.js');
s.onload = () => (window.__nip46 ? resolve(window.__nip46) : reject(new Error('signer module unavailable')));
s.onerror = () => { _nip46 = null; reject(new Error('could not load the remote-signer module')); };
document.head.appendChild(s);