summaryrefslogtreecommitdiffhomepage
path: root/applications/luci-app-transmission
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2020-05-06 00:27:10 +0200
committerJo-Philipp Wich <jo@mein.io>2020-05-06 00:27:42 +0200
commit2a94e18d9b71208b19468c7e2d26168b0609601b (patch)
tree4ce6bb4446a726a8279bf07a73b8237d1b6a608e /applications/luci-app-transmission
parent9c4f3454d23dc8edd81d9ad7462a2e51d7ca3c3f (diff)
luci-app-transmission: fix service running check
Fixes: #3950 Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'applications/luci-app-transmission')
-rw-r--r--applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js8
1 files changed, 2 insertions, 6 deletions
diff --git a/applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js b/applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js
index aecb4ecaa..f2c42ddba 100644
--- a/applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js
+++ b/applications/luci-app-transmission/htdocs/luci-static/resources/view/transmission.js
@@ -10,7 +10,7 @@ var callServiceList = rpc.declare({
object: 'service',
method: 'list',
params: [ 'name' ],
- expect: { '': {} }
+ expect: { 'transmission': {} }
});
function setFlagBool(o) {
@@ -29,11 +29,7 @@ return view.extend({
render: function(res) {
var port = uci.get_first('transmission', 'transmission', 'rpc_port') || '9091';
- var instances = {};
- try {
- instances = res[0]['transmission']['instances'];
- } catch (e) {}
- var running = instances.length > 0;
+ var running = Object.keys(res[0].instances || {}).length > 0;
var webinstalled = res[1] || !!uci.get_first('transmission', 'transmission', 'web_home');