mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 12:52:26 +00:00
fix(more-menu): make ⋯ "Event Details" robust + non-silent (#31)
The wiring was structurally intact (menu item event-details → handler case → handleEventDetailsAction → EventDetailsModal.open), so the failure was silent: - handleEventDetailsAction only opened the modal `if (… && payload.video)` and never caught the async open() rejection — any miss = nothing happens. - EventDetailsModal.open ran the (throwable) renderVersion BEFORE openStaticModal, so a render hiccup left the click looking dead. Hardened: - handleEventDetailsAction surfaces "No video selected" / "unavailable" instead of failing silently, falls back to app.eventDetailsModal, and .catch()es open(). - open() now shows the modal (openStaticModal) FIRST, then renders in a try/catch. - The ⋯ popover is dismissed before opening the modal. Couldn't repro by inspection, so this both fixes the likely causes and makes any remaining failure visible (a toast / console warn naming the exact reason). Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
36f3c6e127
commit
63dcb5f6ed
5 files changed
+46
-14
No files matched your search
@@ -694,10 +694,21 @@ export default class ApplicationBootstrap {
|
||||
handleEnsurePresenceAction: (payload) =>
|
||||
app.handleEnsurePresenceAction(payload),
|
||||
handleEventDetailsAction: (payload) => {
|
||||
if (app.modalManager && app.modalManager.eventDetailsModal && payload?.video) {
|
||||
app.modalManager.eventDetailsModal.open(payload.video);
|
||||
const modal =
|
||||
app.modalManager?.eventDetailsModal || app.eventDetailsModal || null;
|
||||
if (!modal || typeof modal.open !== "function") {
|
||||
app.showError?.("Event details are unavailable.");
|
||||
return Promise.resolve();
|
||||
}
|
||||
return Promise.resolve();
|
||||
const video = payload?.video || null;
|
||||
if (!video) {
|
||||
// Don't fail silently — this is the bug the ⋯ "Event Details" button hit.
|
||||
app.showError?.("No video selected for event details.");
|
||||
return Promise.resolve();
|
||||
}
|
||||
return Promise.resolve(modal.open(video)).catch((error) => {
|
||||
devLogger.warn("[eventDetails] Failed to open event details:", error);
|
||||
});
|
||||
},
|
||||
loadVideos: () => app.loadVideos(),
|
||||
refreshAllVideoGrids: (options) => app.refreshAllVideoGrids(options),
|
||||
|
||||
Reference in new issue
Block a user