mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-06 12:52:26 +00:00
Allow comments without definition address
This commit is contained in:
1 parent
38d706737f
commit
a4e6db7151
4 files changed
+180
-10
No files matched your search
@@ -141,7 +141,7 @@ export default class CommentThreadService {
|
||||
this.parentCommentId = normalizeString(parentCommentId);
|
||||
this.activeRelays = Array.isArray(relays) ? [...relays] : null;
|
||||
|
||||
if (!this.videoEventId || !this.videoAddressPointer) {
|
||||
if (!this.videoEventId) {
|
||||
this.emitError(
|
||||
new Error("Unable to resolve video pointer for comment thread."),
|
||||
);
|
||||
@@ -158,10 +158,13 @@ export default class CommentThreadService {
|
||||
const fetchLimit = toPositiveInteger(limit, this.defaultLimit);
|
||||
const target = {
|
||||
videoEventId: this.videoEventId,
|
||||
videoDefinitionAddress: this.videoAddressPointer,
|
||||
parentCommentId: this.parentCommentId,
|
||||
};
|
||||
|
||||
if (this.videoAddressPointer) {
|
||||
target.videoDefinitionAddress = this.videoAddressPointer;
|
||||
}
|
||||
|
||||
let events = [];
|
||||
try {
|
||||
events = await this.fetchVideoComments(target, {
|
||||
|
||||
@@ -132,7 +132,7 @@ export default class VideoModalCommentController {
|
||||
const videoEventId = normalizeString(video.id);
|
||||
const videoDefinitionAddress = buildVideoAddressPointer(video);
|
||||
|
||||
if (!videoEventId || !videoDefinitionAddress) {
|
||||
if (!videoEventId) {
|
||||
this.resetModalCommentState({ hide: false });
|
||||
this.videoModal.setCommentStatus?.(
|
||||
"Comments are unavailable for this video.",
|
||||
@@ -142,7 +142,7 @@ export default class VideoModalCommentController {
|
||||
|
||||
this.modalCommentState = {
|
||||
videoEventId,
|
||||
videoDefinitionAddress,
|
||||
videoDefinitionAddress: videoDefinitionAddress || null,
|
||||
parentCommentId: null,
|
||||
};
|
||||
this.modalCommentProfiles = new Map();
|
||||
@@ -487,7 +487,7 @@ export default class VideoModalCommentController {
|
||||
const videoEventId = normalizeString(video.id);
|
||||
const videoDefinitionAddress = buildVideoAddressPointer(video);
|
||||
|
||||
if (!videoEventId || !videoDefinitionAddress) {
|
||||
if (!videoEventId) {
|
||||
this.callbacks.showError("Comments are unavailable for this video.");
|
||||
return;
|
||||
}
|
||||
@@ -499,13 +499,18 @@ export default class VideoModalCommentController {
|
||||
reason: "submitting",
|
||||
});
|
||||
|
||||
const publishPayload = {
|
||||
videoEventId,
|
||||
parentCommentId,
|
||||
};
|
||||
|
||||
if (videoDefinitionAddress) {
|
||||
publishPayload.videoDefinitionAddress = videoDefinitionAddress;
|
||||
}
|
||||
|
||||
const publishPromise = Promise.resolve(
|
||||
this.services.publishComment(
|
||||
{
|
||||
videoEventId,
|
||||
videoDefinitionAddress,
|
||||
parentCommentId,
|
||||
},
|
||||
publishPayload,
|
||||
{
|
||||
content: text,
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user