From 681b6f741fca1052e660d224e43e3b03adbc5386 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Thu, 6 May 2021 12:27:32 -0700 Subject: [PATCH] Fix race condition on 4chan /g/ and /sci/. --- src/Miscellaneous/Fourchan.coffee | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Miscellaneous/Fourchan.coffee b/src/Miscellaneous/Fourchan.coffee index 9a50a5c1c..6c8b88b4f 100644 --- a/src/Miscellaneous/Fourchan.coffee +++ b/src/Miscellaneous/Fourchan.coffee @@ -25,7 +25,9 @@ Fourchan = Callbacks.Post.push name: 'Parse [code] tags' cb: Fourchan.code - g.posts.forEach (post) -> Callbacks.Post.execute post, ['Parse [code] tags'], true + g.posts.forEach (post) -> + if post.callbacksExecuted + Callbacks.Post.execute post, ['Parse [code] tags'], true ExpandComment.callbacks.push Fourchan.code if g.BOARD.config.math_tags @@ -46,7 +48,9 @@ Fourchan = Callbacks.Post.push name: 'Parse [math] tags' cb: Fourchan.math - g.posts.forEach (post) -> Callbacks.Post.execute post, ['Parse [math] tags'], true + g.posts.forEach (post) -> + if post.callbacksExecuted + Callbacks.Post.execute post, ['Parse [math] tags'], true ExpandComment.callbacks.push Fourchan.math # Disable 4chan's ID highlighting (replaced by IDHighlight) and reported post hiding.