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:
parent
497b375eeb
commit
b5f11bf6ee
1 changed files with 5 additions and 3 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue