diff options
author | Jo-Philipp Wich <jo@mein.io> | 2022-10-22 15:46:47 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2022-10-22 15:46:47 +0200 |
commit | b5f11bf6ee5ceb04c36d9f88ce82386430321741 (patch) | |
tree | 188b44dc505998b1e1243f6f0895c8b039cbd05d | |
parent | 497b375eeb5f9257fff16f99d4299f5303bd46ad (diff) |
luci-mod-status: fix determining DSL modem type
The `network.getDSLModemType()` function returns a promise, so handle it
accordingly.
Fixes: 45ab2cd6be ("luci-mod-status: use network.getDSLModemType()")
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
-rw-r--r-- | modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/50_dsl.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/50_dsl.js b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/50_dsl.js index b6f24b1aab..0ee0b9033a 100644 --- a/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/50_dsl.js +++ b/modules/luci-mod-status/htdocs/luci-static/resources/view/status/include/50_dsl.js @@ -45,10 +45,12 @@ return baseclass.extend({ title: _('DSL'), load: function() { - if (!network.getDSLModemType()) - return Promise.reject(); + return network.getDSLModemType().then(function(type) { + if (!type) + return Promise.reject(); - return L.resolveDefault(callDSLMetrics(), {}); + return L.resolveDefault(callDSLMetrics(), {}); + }); }, render: function(dsl) { |