From 5e0e4c033791ff976e85391daeea2a7016a49858 Mon Sep 17 00:00:00 2001 From: ccd0 Date: Tue, 22 Jan 2019 20:26:39 -0800 Subject: [PATCH] Fix false detection of posts added by updater on Tinyboard as own posts. --- src/Miscellaneous/Tinyboard.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Miscellaneous/Tinyboard.coffee b/src/Miscellaneous/Tinyboard.coffee index 89969822a..b4865bdb1 100644 --- a/src/Miscellaneous/Tinyboard.coffee +++ b/src/Miscellaneous/Tinyboard.coffee @@ -6,8 +6,10 @@ Tinyboard = $.global -> {boardID, threadID} = document.currentScript.dataset threadID = +threadID - window.$(document).on 'new_post', (e, post) -> - postID = +post.id.match(/\d*$/)[0] + form = document.querySelector 'form[name="post"]' + window.$(document).ajaxComplete (event, request, settings) -> + return unless settings.url is form.action + return unless (postID = +request.responseJSON?.id) detail = {boardID, threadID, postID} event = new CustomEvent 'QRPostSuccessful', {bubbles: true, detail: detail} document.dispatchEvent event