Skip to content

Commit 8a6e63b

Browse files
committed
thread wrapper can be absent at the time of handling follow/unfollow success when clicking too fast
1 parent d2f2a81 commit 8a6e63b

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

app/assets/javascripts/comments.js

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -250,8 +250,11 @@ $(() => {
250250

251251
QPixel.handleJSONResponse(data, () => {
252252
const wrapper = getCommentThreadWrapper($tgt);
253-
const inline = isInlineCommentThread(wrapper);
254-
openThread(wrapper, threadID, { inline });
253+
254+
if (wrapper) {
255+
const inline = isInlineCommentThread(wrapper);
256+
openThread(wrapper, threadID, { inline });
257+
}
255258
});
256259
});
257260

@@ -265,8 +268,11 @@ $(() => {
265268

266269
QPixel.handleJSONResponse(data, () => {
267270
const wrapper = getCommentThreadWrapper($tgt);
268-
const inline = isInlineCommentThread(wrapper);
269-
openThread(wrapper, threadID, { inline });
271+
272+
if (wrapper) {
273+
const inline = isInlineCommentThread(wrapper);
274+
openThread(wrapper, threadID, { inline });
275+
}
270276
});
271277
})
272278

0 commit comments

Comments
 (0)