diff --git a/js/lcn/thread_autoupdater.js b/js/lcn/thread_autoupdater.js index 569206d2..13e02cd5 100644 --- a/js/lcn/thread_autoupdater.js +++ b/js/lcn/thread_autoupdater.js @@ -151,19 +151,27 @@ $().ready(() => { } } + const refresh = () => { + secondsCounter = 0; + onTickFn(); + } + $(document).on("ajax_after_post", (_, xhr_body) => { if (kIsEnabled.getValue() && xhr_body != null) { - const thread = LCNThread.first() - const dom = parser.parseFromString(xhr_body.thread, "text/html") - updateThreadFn(thread, dom) - updateSecondsByTSLP(thread.getReplies().at(-1).getInfo()) + if (xhr_body['mod'] == true) { + refresh(); + } else { + const thread = LCNThread.first() + const dom = parser.parseFromString(xhr_body.thread, "text/html") + updateThreadFn(thread, dom) + updateSecondsByTSLP(thread.getReplies().at(-1).getInfo()) + } } }) $(document).on("thread_manual_refresh", () => { if (kIsEnabled.getValue() && secondsCounter >= 0) { - secondsCounter = 0 - onTickFn() + refresh(); } }) diff --git a/post.php b/post.php index 52ed7605..27c153da 100644 --- a/post.php +++ b/post.php @@ -1495,7 +1495,8 @@ function handle_post(){ 'noko' => $noko, 'id' => $id, 'thread_id' => $thread_id, - 'thread' => $rendered_thread + 'thread' => $rendered_thread, + 'mod' => !!$post['mod'] )); }