From 7cbd77110d5838834ee0740282981132715753c4 Mon Sep 17 00:00:00 2001 From: thePR0M3TH3AN <53631862+PR0M3TH3AN@users.noreply.github.com> Date: Mon, 6 Jul 2026 21:14:14 -0400 Subject: [PATCH] submissions(#23): coerce getEditors() (Set) before mapping in the submissions pane MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With FEATURE_SUBMISSIONS on, refreshAdminPaneState fires populateSubmissions, which mapped accessControl.getEditors() directly — but that returns a Set, so `.map` threw ("map is not a function") as a leaked async rejection after the profile-modal test ended. Coerce with Array.from() (handles Set or array). profile-modal-controller tests 26/26. Co-Authored-By: Claude Opus 4.8 --- js/ui/profileModal/submissionsSection.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/ui/profileModal/submissionsSection.js b/js/ui/profileModal/submissionsSection.js index 9a823d29..dbd6b897 100644 --- a/js/ui/profileModal/submissionsSection.js +++ b/js/ui/profileModal/submissionsSection.js @@ -36,7 +36,8 @@ export async function populateSubmissions(controller) { } const adminHex = safeDecodeNpub(controller.mainController.adminSuperNpub); - const editorHexes = (accessControl.getEditors?.() || []) + // getEditors() may return a Set (or array) — coerce before mapping. + const editorHexes = Array.from(accessControl.getEditors?.() || []) .map((npub) => safeDecodeNpub(npub)) .filter(Boolean);