morse-mode: (APP-3395, PR #819) correctly preference STA in mode

When we have multiple modes, we preference STA/MESH so
we can better identify Extender and Mesh states.
Or at least that was the intent...


Approved-by: Sophronia Koilpillai
Approved-by: Evan Benn
This commit is contained in:
James Haggerty 2024-09-06 06:25:50 +00:00 committed by Arien Judge
parent 1f3fbdb40c
commit 90910e8c2e

View File

@ -126,7 +126,7 @@ function get_best_halow_iface(device) {
}
const IFACE_ORDER = ['sta', 'mesh', 'adhoc', 'ap', 'monitor'];
sort(ifaces, (a, b) => IFACE_ORDER.index(a) - IFACE_ORDER.index(b));
sort(ifaces, (a, b) => index(IFACE_ORDER, a.mode) - index(IFACE_ORDER, b.mode));
return ifaces[0];
}