mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-10-27 07:52:24 +00:00
Improve channel view loading and fix card menu
This commit is contained in:
1 parent
cb18615c1b
commit
eaae8066da
2 files changed
+23
-4
No files matched your search
+22
-4
@@ -1360,12 +1360,22 @@ export async function initChannelProfileView() {
|
||||
|
||||
setupChannelShareButton();
|
||||
setupChannelMoreMenu();
|
||||
await updateChannelMenuState();
|
||||
|
||||
const initialMenuRefresh = updateChannelMenuState().catch((error) => {
|
||||
console.error("Failed to prepare channel menu state:", error);
|
||||
});
|
||||
|
||||
let subscriptionsTask = null;
|
||||
// 3) If user is logged in, load subscriptions and show sub/unsub button
|
||||
if (app?.pubkey) {
|
||||
await subscriptions.loadSubscriptions(app.pubkey);
|
||||
renderSubscribeButton(hexPub);
|
||||
subscriptionsTask = subscriptions
|
||||
.loadSubscriptions(app.pubkey)
|
||||
.catch((error) => {
|
||||
console.error("Failed to load subscriptions for channel view:", error);
|
||||
})
|
||||
.finally(() => {
|
||||
renderSubscribeButton(hexPub);
|
||||
});
|
||||
} else {
|
||||
const btn = document.getElementById("subscribeBtnArea");
|
||||
if (btn) btn.classList.add("hidden");
|
||||
@@ -1388,7 +1398,15 @@ export async function initChannelProfileView() {
|
||||
console.error("Failed to load channel videos:", error);
|
||||
});
|
||||
|
||||
await Promise.allSettled([profilePromise, videosPromise]);
|
||||
const pendingTasks = [profilePromise, videosPromise];
|
||||
if (initialMenuRefresh) {
|
||||
pendingTasks.push(initialMenuRefresh);
|
||||
}
|
||||
if (subscriptionsTask) {
|
||||
pendingTasks.push(subscriptionsTask);
|
||||
}
|
||||
|
||||
await Promise.allSettled(pendingTasks);
|
||||
}
|
||||
|
||||
function setupZapButton() {
|
||||
|
||||
@@ -639,6 +639,7 @@ export class VideoCard {
|
||||
},
|
||||
});
|
||||
button.dataset.moreDropdown = String(this.index);
|
||||
button.dataset.moreMenuToggleBound = "true";
|
||||
|
||||
const icon = this.document.createElement("img");
|
||||
icon.src = "assets/svg/ellipsis.svg";
|
||||
|
||||
Reference in new issue
Block a user