Skip to content

Commit 0014929

Browse files
committed
re-added port sorting
1 parent 6652b05 commit 0014929

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

core/serial.js

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -598,8 +598,14 @@ To add a new serial device, you must add an object to
598598
}, {});
599599

600600
callback(
601-
results.flatMap((result) => result.value),
602-
results.some((result) => result.shouldCallAgain)
601+
results
602+
.flatMap((result) => result.value)
603+
.sort((a, b) => {
604+
if (a.unimportant && !b.unimportant) return 1;
605+
if (b.unimportant && !a.unimportant) return -1;
606+
return 0;
607+
}),
608+
results.some((result) => result.shouldCallAgain),
603609
);
604610
});
605611
};

0 commit comments

Comments
 (0)