diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index afcbe295..6dc5260c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -478,7 +478,7 @@ jobs: run: npm ci - name: Install Playwright browsers - run: npx playwright install --with-deps chromium + run: npx playwright install --with-deps chromium firefox - name: Run headless E2E tests run: npm run test:e2e diff --git a/js/adminListStore.js b/js/adminListStore.js index afed1d2f..9f2805c2 100644 --- a/js/adminListStore.js +++ b/js/adminListStore.js @@ -523,6 +523,18 @@ function extractNpubsFromEvent(event) { async function fetchLatestListEvent(filter, contextLabel = "admin-list") { const nostrClient = requireNostrClient(); + + if (!nostrClient.pool && nostrClient.initPromise) { + try { + await nostrClient.initPromise; + } catch (error) { + devLogger.warn( + `[adminListStore] Awaiting nostrClient init failed during ${contextLabel} fetch:`, + error, + ); + } + } + const relays = ensureNostrReady(); const kind = (Array.isArray(filter?.kinds) && filter.kinds.length) @@ -827,6 +839,18 @@ function publishListWithFirstAcceptance(pool, relays, event, options = {}) { async function persistNostrState(actorNpub, updates = {}) { const nostrClient = requireNostrClient(); + + if (!nostrClient.pool && nostrClient.initPromise) { + try { + await nostrClient.initPromise; + } catch (error) { + devLogger.warn( + "[adminListStore] Awaiting nostrClient init failed during persist:", + error, + ); + } + } + ensureNostrReady(); const permissionResult = await requestDefaultExtensionPermissions(); if (!permissionResult.ok) {