From ef0573a409dcb8d6875caef0e7dd8481a673b05b Mon Sep 17 00:00:00 2001 From: awsr <43862868+awsr@users.noreply.github.com> Date: Thu, 19 Mar 2026 14:57:18 -0700 Subject: [PATCH] Fix TypeError `func` is optional for `Array.prototype.sort()`, but `undefined` needs to be used. --- javascript/gallery.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/javascript/gallery.js b/javascript/gallery.js index 7aca1a047..f1b6cb450 100644 --- a/javascript/gallery.js +++ b/javascript/gallery.js @@ -32,7 +32,7 @@ const gallerySorter = { resD: { name: 'Resolution Descending', func: (b, a) => a.width * a.height - b.width * b.height }, modA: { name: 'Modified Ascending', func: (a, b) => a.mtime - b.mtime }, modD: { name: 'Modified Descending', func: (b, a) => a.mtime - b.mtime }, - none: { name: 'None', func: null }, + none: { name: 'None', func: undefined }, }; let sortMode = gallerySorter.none;