diff --git a/app/services/docker/pluginService.js b/app/services/docker/pluginService.js index b7d94d4e4..85a054738 100644 --- a/app/services/docker/pluginService.js +++ b/app/services/docker/pluginService.js @@ -5,16 +5,17 @@ angular.module('portainer.services') service.plugins = function() { var deferred = $q.defer(); + var plugins = []; Plugin.query({}).$promise .then(function success(data) { - var plugins = data.map(function (item) { - return new PluginViewModel(item); - }); - deferred.resolve(plugins); + for (var i = 0; i < data.length; i++) { + var plugin = new PluginViewModel(data[i]); + plugins.push(plugin); + } }) - .catch(function error(err) { - deferred.reject({ msg: 'Unable to retrieve plugins', err: err }); + .finally(function final() { + deferred.resolve(plugins); }); return deferred.promise; @@ -61,7 +62,7 @@ angular.module('portainer.services') }; service.loggingPlugins = function(systemOnly) { - return servicePlugins(systemOnly, 'Log', 'docker.logdriver/1.0'); + return servicePlugins(systemOnly, 'Log', 'docker.logdriver/1.0'); }; return service; diff --git a/app/services/extensionManager.js b/app/services/extensionManager.js index 32dfe9f0f..9e8b77ae4 100644 --- a/app/services/extensionManager.js +++ b/app/services/extensionManager.js @@ -23,10 +23,9 @@ angular.module('portainer.services') if (_.includes(volumePlugins, 'cio:latest')) { extensions.push('storidge'); } - deferred.resolve(extensions); }) - .catch(function error(err) { - deferred.reject({ msg: 'Unable to retrieve extensions', err: err }); + .finally(function final() { + deferred.resolve(extensions); }); return deferred.promise;