Skip to content

Commit

Permalink
Rebuilt dist/ before release
Browse files Browse the repository at this point in the history
  • Loading branch information
pazdera committed Mar 22, 2017
1 parent 4ece4a4 commit 5074354
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions dist/kano-world-sdk.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,14 @@ module.exports = function (config) {
var token = null,
session = null,
isKW,
isElectron,
auth,
xdAuth;

module.exports = function (config) {
config = config ? config : require('../config');
isKW = config.WORLD_URL.indexOf(location.origin.replace(/(http:|https:)/, '')) !== -1;
isElectron = navigator.userAgent.indexOf("Electron") > -1;

apiService = require('./kano-api')(config);
xdAuth = require('./xd-auth')(config);
Expand All @@ -85,7 +87,7 @@ module.exports = function (config) {
} else {
localStorage.setItem('KW_TOKEN', token);
}
if (!disableCross && !isKW) {
if (!disableCross && !isKW && !isElectron) {
xdAuth.setToken(token);
}
},
Expand All @@ -101,7 +103,7 @@ module.exports = function (config) {
logout: function (reload) {
reload = typeof reload === 'undefined' ? true : reload;
auth.setToken(null);
if (!isKW) {
if (!isKW && !isElectron) {
xdAuth.crossLogout(function (err) {
if (reload) {
location.reload();
Expand Down Expand Up @@ -130,8 +132,8 @@ module.exports = function (config) {
});
}

// The current website is KW, we read directly the locaStorage
if (isKW) {
// The current website is either KW or running inside Electron, we read directly the locaStorage
if (isKW || isElectron) {
p = onToken(token || localStorage.getItem('KW_TOKEN'));
}
// Otherwise, contact KW to get the toekn throught the iframe
Expand Down Expand Up @@ -1226,7 +1228,7 @@ module.exports = function (api) {
'<div class="x-username-field">\
<label style="float: left">Username</label>\
<div id="generateUsername" class="generate-nickname">Generate a Random Name</div>\
<input id="input" class="block" type="text" required/>\
<input id="input" class="block" type="text" required autofocus/>\
<div id="errors" class="errors"></div>\
</div>',
/*jshint multistr: false */
Expand Down

0 comments on commit 5074354

Please sign in to comment.