mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-30 17:32:26 +00:00
This commit fixes a critical race condition where `window.nostr` might not be injected before the app attempts to use it, causing failures in decryption (subscriptions, hashtags, DMs) and login flows. Changes: - Updated `ensureExtensionPermissions` in `js/nostr/client.js` to verify `window.nostr` existence even when permissions are cached. If missing, it now awaits `waitForNip07Extension` instead of returning a false success. - Updated `ensureActiveSignerForPubkey` in `js/nostr/client.js` to wait for the extension if permissions are cached but `window.nostr` is missing, ensuring a valid signer is created. This ensures that the "Performance Analysis" optimization (skipping `enable()` calls based on cache) does not break functionality when the extension injection is delayed. Co-authored-by: PR0M3TH3AN <[email protected]>