From 2e26c3bb9d8d61705bddb68772fe8d724471b733 Mon Sep 17 00:00:00 2001 From: Karl Stolley Date: Fri, 27 Sep 2024 10:55:28 -0500 Subject: [PATCH] lightbox: Show first media element on hotkey activation. --- web/src/lightbox.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/web/src/lightbox.ts b/web/src/lightbox.ts index 05d2e88c8e..f041d93c4f 100644 --- a/web/src/lightbox.ts +++ b/web/src/lightbox.ts @@ -469,7 +469,10 @@ export function show_from_selected_message(): void { if ($media.length !== 0) { const open_media = build_open_media_function(undefined); - open_media($media); + // Since this function is only called from the "show_lightbox" + // hotkey, we don't have a selected image to load. Therefore, + // we show the first one returned from the traversal above. + open_media($media.first()); } }