diff --git a/togetherjs/session.js b/togetherjs/session.js index 62e6006a0..7a7ae747b 100644 --- a/togetherjs/session.js +++ b/togetherjs/session.js @@ -278,6 +278,7 @@ define(["require", "util", "channels", "jquery", "storage"], function (require, var isClient = true; var set = true; var sessionId; + var isClientKey; session.firstRun = ! TogetherJS.startup.continued; if (! shareId) { if (TogetherJS.startup._joinShareId) { @@ -329,7 +330,8 @@ define(["require", "util", "channels", "jquery", "storage"], function (require, return; } else if (TogetherJS.startup._launch) { if (saved) { - isClient = saved.reason == "joined"; + isClientKey = storage.tab.prefix + 'isClient'; + isClient = JSON.parse(storage.tab.storage[isClientKey]); if (! shareId) { shareId = saved.shareId; } @@ -450,6 +452,11 @@ define(["require", "util", "channels", "jquery", "storage"], function (require, if (includeHashInUrl) { $(window).on("hashchange", hashchangeEvent); } + storage.tab.get('isClient').then(function(client) { + if (typeof (client) === 'undefined') { + storage.tab.set('isClient', session.isClient); + } + }); }); session.on("close", function () {