Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Removing the auto included env query parameter since the login page w…
…ill now provided it by default. Added in messaging to allow refreshing the webview if we relaunch the app
  • Loading branch information
dseabolt committed Sep 20, 2019
commit 64dff26711e0e56b774e665c2d0148eb359b22ef
5 changes: 5 additions & 0 deletions background.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,11 @@ function launch(launchData) {
chrome.storage.local.remove('relativeLaunchUrl', launchApp);
}

// If we are relaunching the app, inform the webview so it'll start again.
if(window.app && relativeUrl) {
chrome.runtime.sendMessage({command: "restart"}, (response) => {});
}

function launchApp() {
var info = {
type: 'onLaunched',
Expand Down
3 changes: 3 additions & 0 deletions browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,10 @@ function handleMessage(message, sender, sendResponse) {
});
});
return !!sendResponse; // wait for response
} else if (message.command === 'restart') {
onload();
}
}

chrome.runtime.onMessageExternal.addListener(handleMessage);
chrome.runtime.onMessage.addListener(handleMessage);
9 changes: 0 additions & 9 deletions parseSettings.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,6 @@ function convertServerSettingsToUrl(serverSettings, launchUrl) {
queryString.push('env=' + serverSettings.env);
}
}

//if no environment set then default to production
var envIndex = queryString.findIndex(function(item) {
return /^env=/.test(item);
});
if (envIndex < 0) {
queryString.push('env=production');
}

queryString.push('platform=chromeApp');

url += (url.indexOf('?') < 0 ? '?' : '&') + queryString.join('&');
Expand Down