From 11ddf5cd7cabbc9ea6e685af669343388376d932 Mon Sep 17 00:00:00 2001 From: Serubin Date: Sat, 20 May 2017 03:18:01 -0400 Subject: [PATCH] Added timeout blocker in conversations. --- resources/js/Conversations.js | 11 ++++++++++- resources/js/Thread.js | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/resources/js/Conversations.js b/resources/js/Conversations.js index 2faf6b1..055881d 100644 --- a/resources/js/Conversations.js +++ b/resources/js/Conversations.js @@ -15,7 +15,7 @@ * limitations under the License. */ -function Conversations(data, elem) { +function Conversations(data, elem, page) { var page_id; var $elem; @@ -76,6 +76,12 @@ function Conversations(data, elem) { Nav(); } + + + if(typeof page != "undefined") { + page_id = page; + } + $refresh_btn.on('click', function() { initial_load = true $elem.empty(); @@ -96,6 +102,9 @@ function Conversations(data, elem) { function refreshConversations() { + if (current_page_id != page_id) + return; + handle_ui = updateConversations if(initial_load) handle_ui = renderConversation diff --git a/resources/js/Thread.js b/resources/js/Thread.js index 6b21549..7a7bed3 100644 --- a/resources/js/Thread.js +++ b/resources/js/Thread.js @@ -251,7 +251,7 @@ function Thread(data) { setTimeout(checkNewMessages, refresh_rate); $msg_entry.focus(); - Conversations(null, $("#side-menu-insert")); + Conversations(null, $("#side-menu-insert"), page_id); $("[data-conversation-list=inserted]").off(); // Refresh messages event