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>
This commit is contained in:
Jo-Philipp Wich 2022-10-22 15:46:47 +02:00
parent 497b375eeb
commit b5f11bf6ee

View file

@ -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) {