Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/passman.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfnuesse <felix.nuesse@t-online.de>2018-12-30 23:06:23 +0300
committerfnuesse <felix.nuesse@t-online.de>2018-12-30 23:06:23 +0300
commit8938ff76a0dd528bd0d4517a858365c2a76ceb5a (patch)
tree5da0ee2ea073e48da4e5130ed974f97a36a75280 /js/app/directives/iconpicker.js
parent81cc7a99782b434bfd482fda8d1cb6cdb004604d (diff)
added notification which tells the user when the fetching failed
Signed-off-by: fnuesse <felix.nuesse@t-online.de>
Diffstat (limited to 'js/app/directives/iconpicker.js')
-rw-r--r--js/app/directives/iconpicker.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/js/app/directives/iconpicker.js b/js/app/directives/iconpicker.js
index 185624c7..0992bc54 100644
--- a/js/app/directives/iconpicker.js
+++ b/js/app/directives/iconpicker.js
@@ -30,7 +30,7 @@
* # passwordGen
*/
angular.module('passmanApp').directive('iconPicker', [
- '$window', 'IconService', '$http', function($window, IconService, $http) {
+ '$window', 'IconService', '$http', 'NotificationService','$translate', function($window, IconService, $http, NotificationService, $translate) {
return {
templateUrl: 'views/partials/icon-picker.html',
restrict: 'A',
@@ -118,14 +118,12 @@
scope.refreshUrlIcon = function(){
var queryUrl = OC.generateUrl('apps/passman/api/v2/geticon/'+btoa(scope.credential.url));
$http.get(queryUrl).then(function (response) {
-
- scope.customIcon = {};
- scope.customIcon.data='data:image/'+response.data.type+';base64,'+response.data.content;
- if (response.data) {
- return response.data;
- } else {
- return response;
- }
+ if(typeof response.data.content !== 'undefined'){
+ scope.customIcon = {};
+ scope.customIcon.data='data:image/'+response.data.type+';base64,'+response.data.content;
+ }else{
+ NotificationService.showNotification($translate.instant('use.icon.refresh.error'), 5000);
+ }
});
};