Skip to content
This repository was archived by the owner on Nov 21, 2019. It is now read-only.

Commit e0f95d5

Browse files
author
icymind
committed
fix activeAdapter
1 parent 79692f1 commit e0f95d5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/renderer/lib/win.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ async function getActiveAdapterIndexAndName () {
5858
const indexAndNamePattern = /^(\d+)\s*(.*)$/i // 注意不要添加 g 标志
5959
headerIncludedIfs.split('\n').slice(1).forEach(line => {
6060
const matchResult = indexAndNamePattern.exec(line.trim())
61-
if (matchResult && !/virtualbox/ig.test(matchResult[2])) {
61+
if (matchResult && !/(virtualbox|vmware)/ig.test(matchResult[2])) {
6262
physicalIfs.push({
6363
index: parseInt(matchResult[1].trim()),
6464
infName: matchResult[2]
6565
})
6666
}
6767
})
68-
return physicalIfs[0]
68+
return physicalIfs.sort((a, b) => a.index > b.index)[0]
6969
}
7070

7171
async function getActiveAdapterIndex () {

0 commit comments

Comments
 (0)