From f423bd5abbec673d74bc57631650ce29c818c61d Mon Sep 17 00:00:00 2001 From: Fergal Moran Date: Thu, 20 Jun 2013 12:11:21 +0100 Subject: [PATCH] Fixed modal check count (don't trust js2coffee) --- static/js/app/lib/utils.coffee | 3 ++- static/js/app/lib/utils.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/static/js/app/lib/utils.coffee b/static/js/app/lib/utils.coffee index 23f3fd2..ded7555 100644 --- a/static/js/app/lib/utils.coffee +++ b/static/js/app/lib/utils.coffee @@ -17,7 +17,8 @@ define ['jquery', 'bootstrap', 'toastr'], ($, bootstrap, toastr) -> if document.cookie.indexOf("sessionId") $.getJSON "/ajax/session_play_count", (data) => console.log "utils: got playcount" - @modal "dlg/PlayCountLoginAlert" if (data.play_count isnt 0) and (data.play_count % com.podnoms.settings.nag_count) is 0 + if data.play_count != 0 and (data.play_count % com.podnoms.settings.nag_count) + @modal "dlg/PlayCountLoginAlert" true showError: (title, message) => diff --git a/static/js/app/lib/utils.js b/static/js/app/lib/utils.js index 63f898d..cea0114 100644 --- a/static/js/app/lib/utils.js +++ b/static/js/app/lib/utils.js @@ -28,7 +28,7 @@ if (document.cookie.indexOf("sessionId")) { $.getJSON("/ajax/session_play_count", function(data) { console.log("utils: got playcount"); - if ((data.play_count !== 0) && (data.play_count % com.podnoms.settings.nag_count) === 0) { + if (data.play_count !== 0 && (data.play_count % com.podnoms.settings.nag_count)) { return _this.modal("dlg/PlayCountLoginAlert"); } });