Skip to content

Commit

Permalink
fix: tizen is quirky
Browse files Browse the repository at this point in the history
and i hate it
  • Loading branch information
reisxd committed Apr 15, 2024
1 parent e2fb43b commit c0d095b
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tizenbrew-app/TizenBrew/service/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ module.exports.onStart = function () {
global.currentClient = null;

function createAdbConnection(isTizen3, ip, testConnection) {
let timeout = null;
if (adb) {
if (adb._stream !== null || adb._stream !== undefined) {
adb._stream.removeAllListeners('connect');
Expand All @@ -41,8 +42,12 @@ module.exports.onStart = function () {
}
});
} else {
global.currentClient.send(JSON.stringify({ type: 'canLaunchInDebug', status: true }));
adb._stream.end();
timeout = setTimeout(() => {
global.currentClient.send(JSON.stringify({ type: 'canLaunchInDebug', status: true }))
adb._stream.removeAllListeners('close');
adb._stream.end();
}, 250);

}
});

Expand All @@ -52,6 +57,8 @@ module.exports.onStart = function () {
});
adb._stream.on('close', () => {
console.log('ADB connection closed.');
clearTimeout(timeout);
global.currentClient.send(JSON.stringify({ type: 'canLaunchInDebug', status: false }));
});

}
Expand Down

0 comments on commit c0d095b

Please sign in to comment.