cipher request login subclass, sync fixes

This commit is contained in:
Kyle Spearrin 2017-09-21 10:43:33 -04:00
parent fa88af8323
commit 56e1f6c25b
4 changed files with 27 additions and 11 deletions

View File

@ -385,7 +385,7 @@
"message": "No"
},
"unexpectedError": {
"message": "An unexpected error has occured."
"message": "An unexpected error has occurred."
},
"nameRequired": {
"message": "Name is required."
@ -429,6 +429,9 @@
"syncingComplete": {
"message": "Syncing complete"
},
"syncingFailed": {
"message": "Syncing failed"
},
"importLoginsConfirmation": {
"message": "You can bulk import logins from the bitwarden.com web vault. Do you want to visit the website now?"
},

View File

@ -3,15 +3,20 @@
this.folderId = cipher.folderId;
this.organizationId = cipher.organizationId;
this.name = cipher.name ? cipher.name.encryptedString : null;
this.notes = cipher.notes ? cipher.notes.encryptedString : null;
this.favorite = cipher.favorite;
if (type === 1) {
// login
this.uri = cipher.uri ? cipher.uri.encryptedString : null;
this.username = cipher.username ? cipher.username.encryptedString : null;
this.password = cipher.password ? cipher.password.encryptedString : null;
this.totp = cipher.totp ? cipher.totp.encryptedString : null;
this.notes = cipher.notes ? cipher.notes.encryptedString : null;
switch (type) {
case 1: // login
this.login = {
uri: cipher.uri ? cipher.uri.encryptedString : null,
username: cipher.username ? cipher.username.encryptedString : null,
password: cipher.password ? cipher.password.encryptedString : null,
totp: cipher.totp ? cipher.totp.encryptedString : null
};
break;
default:
break;
}
};

View File

@ -9,11 +9,16 @@
$scope.sync = function () {
$scope.loading = true;
syncService.fullSync(true, function () {
$analytics.eventTrack('Synced Full');
syncService.fullSync(true, function (success) {
$scope.loading = false;
toastr.success(i18nService.syncingComplete);
setLastSync();
if (success) {
$analytics.eventTrack('Synced Full');
toastr.success(i18nService.syncingComplete);
}
else {
toastr.error(i18nService.syncingFailed);
}
});
};

View File

@ -61,6 +61,9 @@ function initSyncService() {
self.syncCompleted(false);
callback(false);
});
}, function () {
self.syncCompleted(false);
callback(false);
});
});
});