1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

fix sync and vault listing bugs

This commit is contained in:
Kyle Spearrin
2016-09-06 23:30:49 -04:00
parent 5a39d4c73e
commit 4092e2ecc3
11 changed files with 85 additions and 58 deletions

View File

@@ -2,7 +2,7 @@
this.id = response.Id;
this.folderId = response.FolderId;
this.type = response.Type;
this.favorite = response.favorite;
this.favorite = response.Favorite;
this.data = response.Data;
this.revisionDate = response.RevisionDate;
};
@@ -21,7 +21,7 @@ var SiteResponse = function (response) {
this.username = response.Username;
this.password = response.Password;
this.notes = response.Notes;
this.favorite = response.favorite;
this.favorite = response.Favorite;
this.revisionDate = response.RevisionDate;
if(response.Folder) {
@@ -47,7 +47,7 @@ var TokenResponse = function (response) {
};
var ListResponse = function (data) {
this.Data = data;
this.data = data;
};
var ErrorResponse = function (response) {

View File

@@ -1,41 +1,43 @@
var FolderData = function (response, userId) {
var data = null;
this.id = response.id;
this.userId = userId;
if (response instanceof FolderResponse) {
data = response;
this.name = response.name;
}
else if (response instanceof CipherResponse) {
data = response.Data;
this.name = response.data.Name;
}
else {
throw 'unsupported instance';
}
this.id = response.id;
this.userId = userId;
this.name = data.name;
this.revisionDate = response.revisionDate;
};
var SiteData = function (response, userId) {
var data = null;
this.id = response.id;
this.folderId = response.folderId;
this.userId = userId;
if (response instanceof SiteResponse) {
data = response;
this.name = response.name;
this.uri = response.uri;
this.username = response.username;
this.password = response.password;
this.notes = response.notes;
}
else if (response instanceof CipherResponse) {
data = response.Data;
this.name = response.data.Name;
this.uri = response.data.Uri;
this.username = response.data.Username;
this.password = response.data.Password;
this.notes = response.notes = response.data.Notes;;
}
else {
throw 'unsupported instance';
}
this.id = response.id;
this.folderId = response.folderId;
this.userId = userId;
this.name = data.name;
this.uri = data.uri;
this.username = data.username;
this.password = data.password;
this.notes = data.notes;
this.favorite = response.favorite;
this.revisionDate = response.revisionDate;
};