Require active signer for comment publishing

This commit is contained in:
thePR0M3TH3AN committed 2025-10-30 11:39:09 -04:00
1 parent 7555fd11b5
commit 59161df063
4 files changed
+191 -121

No files matched your search

+18 -1
View File
@@ -628,7 +628,7 @@ export default class VideoModalCommentController {
try {
const result = await publishPromise;
if (!result?.ok || !result.event) {
throw result?.error || new Error("publish-failed");
throw result || { error: "publish-failed" };
}
const event = this.enrichCommentEvent(result.event);
@@ -650,6 +650,23 @@ export default class VideoModalCommentController {
this.applyCommentComposerAuthState();
this.videoModal.setCommentStatus?.("Comment posted.");
} catch (error) {
const authRequired =
(error && typeof error === "object" && error.error === "auth-required") ||
error === "auth-required";
if (authRequired) {
this.videoModal.setCommentComposerState?.({
disabled: true,
reason: "login-required",
});
this.handleVideoModalCommentLoginRequired(detail);
this.videoModal.setCommentComposerState?.({
disabled: true,
reason: "login-required",
});
return;
}
devLogger.warn("[comment] Failed to publish comment:", error);
this.videoModal.setCommentComposerState?.({
disabled: false,