From edb0d9da89747a6bf8031e201c3a97b73e78e285 Mon Sep 17 00:00:00 2001 From: KPal Date: Thu, 15 Oct 2026 17:59:28 +0100 Subject: [PATCH] fix: gallery crash when sorting boolean pinned flags --- plugins/spatial-artifacts/web/viewer.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/plugins/spatial-artifacts/web/viewer.js b/plugins/spatial-artifacts/web/viewer.js index 5dc3374..9f801f6 100644 --- a/plugins/spatial-artifacts/web/viewer.js +++ b/plugins/spatial-artifacts/web/viewer.js @@ -586,9 +586,7 @@ const gallery = () => { } // pinned first, then newest - list = r.sort( - (a, b) => (b.pinned ?? '').localeCompare(a.pinned ?? '') || b.updatedAt.localeCompare(a.updatedAt), - ); + list = r.sort((a, b) => !!b.pinned - !!a.pinned || b.updatedAt.localeCompare(a.updatedAt)); render(); };