From 872e726dbdb5e73ce1f21ca289db5cf259aa82d7 Mon Sep 17 00:00:00 2001 From: OldHawk Date: Mon, 14 May 2018 16:53:16 +0800 Subject: [PATCH] fix(status): show download percent on torrent item --- .../client/directives/torrent-progress.client.directive.js | 6 +++--- .../torrents/client/templates/torrent-item.client.view.html | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/core/client/directives/torrent-progress.client.directive.js b/modules/core/client/directives/torrent-progress.client.directive.js index b542558e..ffb37ed5 100644 --- a/modules/core/client/directives/torrent-progress.client.directive.js +++ b/modules/core/client/directives/torrent-progress.client.directive.js @@ -20,9 +20,9 @@ function link(scope, element, attrs) { scope.$watch(attrs.torrentProgress, function (p) { - if (p && p.length > 0) { - var pt = p[0]; - //mtDebug.info(pt); + var pt = Array.isArray(p) ? (p.length > 0 ? p[0] : undefined) : p; + if (pt) { + mtDebug.info(pt); var t_progressbar = ngProgressFactory.createInstance(); t_progressbar.setParent(element[0]); diff --git a/modules/torrents/client/templates/torrent-item.client.view.html b/modules/torrents/client/templates/torrent-item.client.view.html index c080ee13..d0db6324 100644 --- a/modules/torrents/client/templates/torrent-item.client.view.html +++ b/modules/torrents/client/templates/torrent-item.client.view.html @@ -276,6 +276,6 @@ -
+