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" "message": "No"
}, },
"unexpectedError": { "unexpectedError": {
"message": "An unexpected error has occured." "message": "An unexpected error has occurred."
}, },
"nameRequired": { "nameRequired": {
"message": "Name is required." "message": "Name is required."
@ -429,6 +429,9 @@
"syncingComplete": { "syncingComplete": {
"message": "Syncing complete" "message": "Syncing complete"
}, },
"syncingFailed": {
"message": "Syncing failed"
},
"importLoginsConfirmation": { "importLoginsConfirmation": {
"message": "You can bulk import logins from the bitwarden.com web vault. Do you want to visit the website now?" "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.folderId = cipher.folderId;
this.organizationId = cipher.organizationId; this.organizationId = cipher.organizationId;
this.name = cipher.name ? cipher.name.encryptedString : null; this.name = cipher.name ? cipher.name.encryptedString : null;
this.notes = cipher.notes ? cipher.notes.encryptedString : null;
this.favorite = cipher.favorite; this.favorite = cipher.favorite;
if (type === 1) { switch (type) {
// login case 1: // login
this.uri = cipher.uri ? cipher.uri.encryptedString : null; this.login = {
this.username = cipher.username ? cipher.username.encryptedString : null; uri: cipher.uri ? cipher.uri.encryptedString : null,
this.password = cipher.password ? cipher.password.encryptedString : null; username: cipher.username ? cipher.username.encryptedString : null,
this.totp = cipher.totp ? cipher.totp.encryptedString : null; password: cipher.password ? cipher.password.encryptedString : null,
this.notes = cipher.notes ? cipher.notes.encryptedString : null; totp: cipher.totp ? cipher.totp.encryptedString : null
};
break;
default:
break;
} }
}; };

View File

@ -9,11 +9,16 @@
$scope.sync = function () { $scope.sync = function () {
$scope.loading = true; $scope.loading = true;
syncService.fullSync(true, function () { syncService.fullSync(true, function (success) {
$analytics.eventTrack('Synced Full');
$scope.loading = false; $scope.loading = false;
toastr.success(i18nService.syncingComplete);
setLastSync(); 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); self.syncCompleted(false);
callback(false); callback(false);
}); });
}, function () {
self.syncCompleted(false);
callback(false);
}); });
}); });
}); });