mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-02 02:42:28 +00:00
fix(popularity): correct lazy-import path + forward video; single-instance modal
Two bugs in the #26 wiring surfaced live: - The ⋯ menu lazy-import used "../../viewCountChart.js" which resolves one level too high (dist/viewCountChart.js → 404 "Failed to fetch dynamically imported module"). Corrected to "../viewCountChart.js" (js/ui → js/viewCountChart.js). - The video-list context path called handleMoreMenuAction without the video, so view-stats hit "No video selected". Forward detail.video. Also make the popularity modal single-instance: close any open one (proper subscription/listener cleanup) before opening a new one, so the two menu paths firing for one click can't stack duplicates or leak a live subscription. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This commit is contained in:
1 parent
575befb83c
commit
6911df075a
2 files changed
+23
-3
No files matched your search
@@ -157,7 +157,7 @@ export default class MoreMenuController {
|
||||
...(detail.dataset || {}),
|
||||
eventId: detail.dataset?.eventId || detail.video?.id || "",
|
||||
};
|
||||
this.handleMoreMenuAction(detail.action, dataset);
|
||||
this.handleMoreMenuAction(detail.action, dataset, detail.video || null);
|
||||
};
|
||||
|
||||
if (typeof view.addEventListener === "function") {
|
||||
@@ -1176,7 +1176,7 @@ export default class MoreMenuController {
|
||||
// ignore
|
||||
}
|
||||
try {
|
||||
const { openPopularityModal } = await import("../../viewCountChart.js");
|
||||
const { openPopularityModal } = await import("../viewCountChart.js");
|
||||
openPopularityModal({ video: targetVideo });
|
||||
} catch (error) {
|
||||
userLogger.warn("[MoreMenu] Failed to open popularity modal:", error);
|
||||
|
||||
Reference in new issue
Block a user