mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-07 13:22:54 +00:00
Add share on Nostr modal
This commit is contained in:
1 parent
8fdbb0c826
commit
012643ce12
4 files changed
+670
-4
No files matched your search
@@ -5,6 +5,7 @@ import { truncateMiddle, formatShortNpub } from "../utils/formatters.js";
|
||||
import { showLoginRequiredToZapNotification } from "../payments/zapNotifications.js";
|
||||
import { VideoModal } from "./components/VideoModal.js";
|
||||
import { RevertModal } from "./components/RevertModal.js";
|
||||
import { ShareNostrModal } from "./components/ShareNostrModal.js";
|
||||
import initUploadModal from "./initUploadModal.js";
|
||||
import initEditModal from "./initEditModal.js";
|
||||
import initDeleteModal from "./initDeleteModal.js";
|
||||
@@ -49,6 +50,7 @@ export default class ModalManager {
|
||||
this.videoModalHandlers = {};
|
||||
|
||||
this.eventDetailsModal = null;
|
||||
this.shareNostrModal = null;
|
||||
|
||||
this.zapController = null;
|
||||
}
|
||||
@@ -170,6 +172,14 @@ export default class ModalManager {
|
||||
app.deleteModal = this.deleteModal;
|
||||
app.deleteModalEvents = this.deleteModalEvents;
|
||||
|
||||
this.shareNostrModal = new ShareNostrModal({
|
||||
removeTrackingScripts,
|
||||
setGlobalModalState,
|
||||
container: modalContainer,
|
||||
fallbackThumbnailSrc: this.assets.fallbackThumbnailSrc,
|
||||
});
|
||||
app.shareNostrModal = this.shareNostrModal;
|
||||
|
||||
this.videoModal =
|
||||
(typeof this.ui.videoModal === "function"
|
||||
? this.ui.videoModal({ app })
|
||||
@@ -698,6 +708,18 @@ export default class ModalManager {
|
||||
}
|
||||
}
|
||||
|
||||
if (this.shareNostrModal && typeof this.shareNostrModal.close === "function") {
|
||||
try {
|
||||
this.shareNostrModal.close();
|
||||
} catch (error) {
|
||||
devLogger.warn("[ModalManager] Failed to close share Nostr modal:", error);
|
||||
}
|
||||
}
|
||||
this.shareNostrModal = null;
|
||||
if (app.shareNostrModal) {
|
||||
app.shareNostrModal = null;
|
||||
}
|
||||
|
||||
if (this.revertModal && this.revertConfirmHandler) {
|
||||
try {
|
||||
this.revertModal.removeEventListener(
|
||||
|
||||
Reference in new issue
Block a user