Don't startPoll if there's not a subscribable heading, i.e. New Topic

Any save errors wouldn't be shown -- most visibly, this meant any new
topic requiring a captcha couldn't be submitted.

Follow-up to 890cec73b6

Bug: T374770
Change-Id: Iac62ba9ccf629185798957dafee774ad1de08396
This commit is contained in:
David Lynch 2024-09-16 19:24:54 -05:00
parent ed451b8bd4
commit bb418d6b60

View file

@ -230,6 +230,13 @@ CommentController.prototype.onVisibilityChange = function () {
CommentController.prototype.startPoll = function ( nextDelay ) { CommentController.prototype.startPoll = function ( nextDelay ) {
nextDelay = nextDelay || 5000; nextDelay = nextDelay || 5000;
if ( !(
this.threadItem instanceof CommentItem &&
this.threadItem.getSubscribableHeading()
) ) {
return;
}
const threadItemId = this.threadItem.id; const threadItemId = this.threadItem.id;
const subscribableHeadingId = this.threadItem.getSubscribableHeading().id; const subscribableHeadingId = this.threadItem.getSubscribableHeading().id;
let aborted = false; let aborted = false;