Skip to content

Commit

Permalink
Fix issue where loader could forget apps if 'don't ask again' was cli…
Browse files Browse the repository at this point in the history
…cked in the watch chooser
  • Loading branch information
gfwilliams committed Nov 10, 2021
1 parent 8b987aa commit 779e550
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function onFoundDeviceInfo(deviceId, deviceVersion) {

var originalAppJSON = undefined;
function filterAppsForDevice(deviceId) {
if (originalAppJSON===undefined)
if (originalAppJSON===undefined && appJSON.length)
originalAppJSON = appJSON;

var device = DEVICEINFO.find(d=>d.id==deviceId);
Expand Down Expand Up @@ -97,8 +97,7 @@ function setSavedDeviceId(deviceId) {
// At boot, show a window to choose which type of device you have...
window.addEventListener('load', (event) => {
let deviceId = getSavedDeviceId()
if (deviceId !== undefined)
return filterAppsForDevice(deviceId);
if (deviceId !== undefined) return; // already chosen

var html = `<div class="columns">
${DEVICEINFO.map(d=>`
Expand Down Expand Up @@ -168,6 +167,10 @@ window.addEventListener('load', (event) => {
});

function onAppJSONLoaded() {
let deviceId = getSavedDeviceId()
if (deviceId !== undefined)
filterAppsForDevice(deviceId);

return new Promise(resolve => {
httpGet("screenshots.json").then(screenshotJSON=>{
var screenshots = [];
Expand Down

0 comments on commit 779e550

Please sign in to comment.