Skip to content

Commit 9c0f071

Browse files
committed
luci-base: check for wifi system feature before Promise.all
Allows the hasSystemFeature call to complete before executing the Promise bundle. Signed-off-by: Paul Donald <[email protected]>
1 parent affbd1b commit 9c0f071

File tree

1 file changed

+2
-1
lines changed
  • modules/luci-base/htdocs/luci-static/resources

1 file changed

+2
-1
lines changed

modules/luci-base/htdocs/luci-static/resources/network.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,7 @@ function maskToPrefix(mask, v6) {
349349

350350
function initNetworkState(refresh) {
351351
if (_state == null || refresh) {
352+
const hasWifi = L.hasSystemFeature('wifi');
352353
_init = _init || Promise.all([
353354
L.resolveDefault(callNetworkInterfaceDump(), []),
354355
L.resolveDefault(callLuciBoardJSON(), {}),
@@ -357,7 +358,7 @@ function initNetworkState(refresh) {
357358
L.resolveDefault(callLuciHostHints(), {}),
358359
getProtocolHandlers(),
359360
L.resolveDefault(uci.load('network')),
360-
L.hasSystemFeature('wifi') ? L.resolveDefault(uci.load('wireless')) : L.resolveDefault(),
361+
hasWifi ? L.resolveDefault(uci.load('wireless')) : L.resolveDefault(),
361362
L.resolveDefault(uci.load('luci'))
362363
]).then(function(data) {
363364
var netifd_ifaces = data[0],

0 commit comments

Comments
 (0)