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
path: root/js
diff options
context:
space:
mode:
authorbinsky <timo@binsky.org>2021-03-22 19:47:25 +0300
committerbinsky <timo@binsky.org>2021-03-22 19:47:25 +0300
commit8b2eeb9eb22d1472440bb1b975b6ce1100231362 (patch)
tree8cc6876f25d6612ed0e3ab863d17ee7b98eb5eab /js
parent1c9be48285439665623decb38e11c01eeffa8829 (diff)
fix setting a custom icon on credential creation
Diffstat (limited to 'js')
-rw-r--r--js/app/directives/iconpicker.js7
-rw-r--r--js/app/services/credentialservice.js7
2 files changed, 5 insertions, 9 deletions
diff --git a/js/app/directives/iconpicker.js b/js/app/directives/iconpicker.js
index 2cc60594..210dfacb 100644
--- a/js/app/directives/iconpicker.js
+++ b/js/app/directives/iconpicker.js
@@ -129,7 +129,9 @@
};
scope.useIcon = function() {
-
+ if(!scope.credential.icon){
+ scope.credential.icon = {};
+ }
if(scope.customIcon){
var data = scope.customIcon.data;
scope.credential.icon.type = data.substring(data.lastIndexOf(":")+1,data.lastIndexOf(";"));
@@ -138,9 +140,6 @@
$http.get(scope.selectedIcon.url).then(function(result) {
var base64Data = window.btoa(result.data);
var mimeType = 'svg+xml';
- if(!scope.credential.icon){
- scope.credential.icon = {};
- }
scope.credential.icon.type = mimeType;
scope.credential.icon.content = base64Data;
});
diff --git a/js/app/services/credentialservice.js b/js/app/services/credentialservice.js
index 53fa67c0..e8bc2a41 100644
--- a/js/app/services/credentialservice.js
+++ b/js/app/services/credentialservice.js
@@ -41,10 +41,7 @@
'changed': null,
'tags': [],
'email': null,
- 'icon':{
- 'type': false,
- 'content': ''
- },
+ 'icon': null,
'username': null,
'password': null,
'url': null,
@@ -364,4 +361,4 @@
}
};
}]);
-}()); \ No newline at end of file
+}());