Skip to content

Commit ffbfc40

Browse files
committed
fix: Fix the problem of abnormal disconnection of adb after changing some configurations
1 parent 0b254bf commit ffbfc40

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

desktop/electron/middleware/adb/index.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import fs from 'node:fs'
22
import path from 'node:path'
3-
import { adbKeyboardApkPath } from '$electron/configs/index.js'
3+
import { adbKeyboardApkPath, getDefaultAdbPath } from '$electron/configs/index.js'
44
import electronStore from '$electron/helpers/store/index.js'
55
import { Adb } from '@devicefarmer/adbkit'
66
import dayjs from 'dayjs'
@@ -24,7 +24,9 @@ electronAPI.ipcRenderer.on('quit-before', () => {
2424
processManager.kill()
2525
})
2626

27-
electronStore.onDidChange('common.adbPath', async (value, oldValue) => {
27+
electronStore.onDidChange('common.adbPath', async (...args) => {
28+
const [value, oldValue = getDefaultAdbPath()] = args
29+
2830
if (value === oldValue) {
2931
return false
3032
}

0 commit comments

Comments
 (0)