mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-08 13:52:58 +00:00
Update share menu auth handling
This commit is contained in:
1 parent
4c55e56955
commit
b70d263eff
3 files changed
+61
-6
No files matched your search
@@ -313,6 +313,7 @@ export function createVideoShareMenuPanel({
|
||||
document: documentRef = null,
|
||||
video = null,
|
||||
isLoggedIn = false,
|
||||
hasSigner = false,
|
||||
hasMagnet = false,
|
||||
hasCdn = false,
|
||||
designSystem = null,
|
||||
@@ -338,10 +339,13 @@ export function createVideoShareMenuPanel({
|
||||
action: "share-nostr",
|
||||
dataset: { eventId: metadata.id },
|
||||
});
|
||||
if (!isLoggedIn) {
|
||||
const canShareOnNostr = Boolean(isLoggedIn) && Boolean(hasSigner);
|
||||
if (!canShareOnNostr) {
|
||||
nostrBtn.disabled = true;
|
||||
nostrBtn.classList.add("opacity-50", "cursor-not-allowed");
|
||||
nostrBtn.title = "Log in to share on Nostr";
|
||||
nostrBtn.title = isLoggedIn
|
||||
? "Connect a Nostr signer to share"
|
||||
: "Log in to share on Nostr";
|
||||
}
|
||||
|
||||
const magnetBtn = appendMenuAction(doc, list, {
|
||||
@@ -488,4 +492,3 @@ export function createVideoSettingsMenuPanel({
|
||||
|
||||
return panel;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user