mirror of
https://github.com/bitwarden/browser.git
synced 2025-03-11 13:30:39 +01:00
Get full cipher details when update cipher notification is received (#3063)
This commit is contained in:
parent
f6571346c2
commit
c0bcdf4637
@ -262,6 +262,7 @@ export abstract class ApiService {
|
|||||||
renewSendFileUploadUrl: (sendId: string, fileId: string) => Promise<SendFileUploadDataResponse>;
|
renewSendFileUploadUrl: (sendId: string, fileId: string) => Promise<SendFileUploadDataResponse>;
|
||||||
|
|
||||||
getCipher: (id: string) => Promise<CipherResponse>;
|
getCipher: (id: string) => Promise<CipherResponse>;
|
||||||
|
getFullCipherDetails: (id: string) => Promise<CipherResponse>;
|
||||||
getCipherAdmin: (id: string) => Promise<CipherResponse>;
|
getCipherAdmin: (id: string) => Promise<CipherResponse>;
|
||||||
getAttachmentData: (
|
getAttachmentData: (
|
||||||
cipherId: string,
|
cipherId: string,
|
||||||
|
@ -589,6 +589,11 @@ export class ApiService implements ApiServiceAbstraction {
|
|||||||
return new CipherResponse(r);
|
return new CipherResponse(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getFullCipherDetails(id: string): Promise<CipherResponse> {
|
||||||
|
const r = await this.send("GET", "/ciphers/" + id + "/details", null, true, true);
|
||||||
|
return new CipherResponse(r);
|
||||||
|
}
|
||||||
|
|
||||||
async getCipherAdmin(id: string): Promise<CipherResponse> {
|
async getCipherAdmin(id: string): Promise<CipherResponse> {
|
||||||
const r = await this.send("GET", "/ciphers/" + id + "/admin", null, true, true);
|
const r = await this.send("GET", "/ciphers/" + id + "/admin", null, true, true);
|
||||||
return new CipherResponse(r);
|
return new CipherResponse(r);
|
||||||
|
@ -198,7 +198,7 @@ export class SyncService implements SyncServiceAbstraction {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (shouldUpdate) {
|
if (shouldUpdate) {
|
||||||
const remoteCipher = await this.apiService.getCipher(notification.id);
|
const remoteCipher = await this.apiService.getFullCipherDetails(notification.id);
|
||||||
if (remoteCipher != null) {
|
if (remoteCipher != null) {
|
||||||
await this.cipherService.upsert(new CipherData(remoteCipher));
|
await this.cipherService.upsert(new CipherData(remoteCipher));
|
||||||
this.messagingService.send("syncedUpsertedCipher", { cipherId: notification.id });
|
this.messagingService.send("syncedUpsertedCipher", { cipherId: notification.id });
|
||||||
|
Loading…
Reference in New Issue
Block a user