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>;
|
||||
|
||||
getCipher: (id: string) => Promise<CipherResponse>;
|
||||
getFullCipherDetails: (id: string) => Promise<CipherResponse>;
|
||||
getCipherAdmin: (id: string) => Promise<CipherResponse>;
|
||||
getAttachmentData: (
|
||||
cipherId: string,
|
||||
|
|
|
@ -589,6 +589,11 @@ export class ApiService implements ApiServiceAbstraction {
|
|||
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> {
|
||||
const r = await this.send("GET", "/ciphers/" + id + "/admin", null, true, true);
|
||||
return new CipherResponse(r);
|
||||
|
|
|
@ -198,7 +198,7 @@ export class SyncService implements SyncServiceAbstraction {
|
|||
}
|
||||
|
||||
if (shouldUpdate) {
|
||||
const remoteCipher = await this.apiService.getCipher(notification.id);
|
||||
const remoteCipher = await this.apiService.getFullCipherDetails(notification.id);
|
||||
if (remoteCipher != null) {
|
||||
await this.cipherService.upsert(new CipherData(remoteCipher));
|
||||
this.messagingService.send("syncedUpsertedCipher", { cipherId: notification.id });
|
||||
|
|
Loading…
Reference in New Issue