mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
submissions(#23): coerce getEditors() (Set) before mapping in the submissions pane
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 <[email protected]>
This commit is contained in:
1 parent
8eddb11a03
commit
7cbd77110d
1 file changed
+2
-1
@@ -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);
|
||||
|
||||
|
||||
Reference in new issue
Block a user