Skip to content

Commit

Permalink
fix: keys not being registered on autolaunch
Browse files Browse the repository at this point in the history
  • Loading branch information
reisxd committed Apr 20, 2024
1 parent 60625f9 commit 7a2b522
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions tizenbrew-app/TizenBrew/js/wsClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ function connect() {
localStorage.removeItem('ip');
window.location.reload();
}
} catch(e) {
} catch (e) {
localStorage.removeItem('ip');
window.location.reload();
}

}

window.send = (message) => {
Expand Down Expand Up @@ -98,8 +98,18 @@ function onMessage(msg) {
return;
} else {
const appPath = app.getAttribute('data-appPath');
send({ type: 'launch', packageName: localStorage.getItem('autoLaunch') });
location.href = appPath;
let keys = app.getAttribute("data-keys");
if (keys.length > 0) {
keys = selectedItem.getAttribute("data-keys").split(',');
for (var i = 0; i < keys.length; i++) {
tizen.tvinputdevice.registerKey(keys[i]);
}
}

setTimeout(() => {
send({ type: 'launch', packageName: localStorage.getItem('autoLaunch') });
location.href = appPath;
}, 250);
}
}
break;
Expand All @@ -119,7 +129,7 @@ function onMessage(msg) {
break;
}
default: {
// This should never happen.
// This should never happen.
}
}
}
Expand Down

0 comments on commit 7a2b522

Please sign in to comment.