Skip to content

Commit

Permalink
perf: ♻️ Improve ADB connection stability
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Sep 9, 2024
1 parent 55ba798 commit 7655ba6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion electron/exposes/adbkit/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,6 @@ const getDeviceIP = async (id) => {
}
catch (error) {
console.warn('adbkit.getDeviceIP.error', error.message)
return false
}
}

Expand Down Expand Up @@ -279,6 +278,7 @@ export default () => {

client = Adb.createClient({
bin: binPath,
timeout: 5 * 1000,
})

return {
Expand Down
11 changes: 8 additions & 3 deletions src/components/Device/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -258,16 +258,21 @@ export default {
this.deviceList = data
}
catch (error) {
console.warn(error)
if (error?.message || error?.cause?.message) {
this.$message.warning(error?.message || error?.cause?.message)
const message = error?.message || error?.cause?.message
console.warn(message)
if (message && !message.includes('daemon not running')) {
this.$message.warning(message)
}
this.deviceList = []
if (resetResolve) {
this.handleReset()
}
}
this.loading = false
},
},
Expand Down

0 comments on commit 7655ba6

Please sign in to comment.