diff options
| author | Jules Laplace <jules@okfoc.us> | 2017-02-19 04:22:43 +0100 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2017-02-19 04:22:43 +0100 |
| commit | 8f03316d04ba3a51ce16d90ffe94d7611c013652 (patch) | |
| tree | 1e1282bafc0cf5ec1f9df8f79323fb3ad7388637 /StoneIsland/www/js | |
| parent | ed12781e91bb9df05d9b0f927f867d5d3c658f6d (diff) | |
get rid of old parse plugin
Diffstat (limited to 'StoneIsland/www/js')
| -rwxr-xr-x | StoneIsland/www/js/lib/etc/push.js | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/StoneIsland/www/js/lib/etc/push.js b/StoneIsland/www/js/lib/etc/push.js index e058a3d4..138c4896 100755 --- a/StoneIsland/www/js/lib/etc/push.js +++ b/StoneIsland/www/js/lib/etc/push.js @@ -23,12 +23,19 @@ var push = (function(){ return } console.log("push did initialize") + var hub_status = localStorage.getItem("yoox.push_hub") + var store_status = localStorage.getItem("yoox.push_store") + push.settings.requested = localStorage.getItem("yoox.push_requested") == "true" - push.settings.hub = localStorage.getItem("yoox.push_hub") == "true" - push.settings.store = localStorage.getItem("yoox.push_store") == "true" + push.settings.hub = hub_status == "true" + push.settings.store = store_status == "true" - push.subscribe("hub", function(s){ console.log("subscribed to hub", s) }) - push.subscribe("store", function(s){ console.log("subscribed to store", s) }) + if (! hub_status || hub_status == "true") { + push.subscribe("hub") + } + if (! store_status || store_status == "true") { + push.subscribe("store") + } } push.got_registration = function(data){ var registrationId = data.registrationId @@ -50,6 +57,9 @@ var push = (function(){ channel: channel, platform: device.platform, } + pushPlugin.subscribe(channel, function(){ + console.log("subscribed to", channel) + }) $.ajax({ method: "POST", url: "https://stone.sup.land/_services/push/add", |
