From b5f11bf6ee5ceb04c36d9f88ce82386430321741 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sat, 22 Oct 2022 15:46:47 +0200 Subject: 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 --- .../htdocs/luci-static/resources/view/status/include/50_dsl.js | 8 +++++--- 1 file 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) { -- cgit v1.2.3