summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2022-10-22 15:46:47 +0200
committerJo-Philipp Wich <jo@mein.io>2022-10-22 15:46:47 +0200
commitb5f11bf6ee5ceb04c36d9f88ce82386430321741 (patch)
tree188b44dc505998b1e1243f6f0895c8b039cbd05d
parent497b375eeb5f9257fff16f99d4299f5303bd46ad (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.js8
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) {