Skip to content
This repository has been archived by the owner on May 14, 2018. It is now read-only.

Commit

Permalink
Added timeout blocker in conversations.
Browse files Browse the repository at this point in the history
  • Loading branch information
Serubin committed May 20, 2017
1 parent 9591f9d commit 11ddf5c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion resources/js/Conversations.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
* limitations under the License.
*/

function Conversations(data, elem) {
function Conversations(data, elem, page) {
var page_id;
var $elem;

Expand Down Expand Up @@ -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();
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion resources/js/Thread.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 11ddf5c

Please sign in to comment.