fix: id cards are wiped/replaced when an error happens in the pipe

This commit is contained in:
2024-10-11 15:33:03 +02:00
parent bb1f596bfc
commit e6c17c860b

View File

@@ -41,7 +41,7 @@ export class IdCardsProvider {
mergeMap(user => this.fetchFallbackIdCards(user)), mergeMap(user => this.fetchFallbackIdCards(user)),
startWith([]), startWith([]),
) )
: of([]).pipe(tap(() => this.encryptedStorageProvider.delete('id-cards'))), : of([]).pipe(tap({next: () => this.encryptedStorageProvider.delete('id-cards')})),
), ),
); );
} }
@@ -54,7 +54,7 @@ export class IdCardsProvider {
}, },
responseType: 'json', responseType: 'json',
}) })
.pipe(tap(idCards => this.encryptedStorageProvider.set('id-cards', idCards))); .pipe(tap({next: idCards => this.encryptedStorageProvider.set('id-cards', idCards)}));
} }
private fetchFallbackIdCards(user: SCUserConfiguration): Observable<SCIdCard[]> { private fetchFallbackIdCards(user: SCUserConfiguration): Observable<SCIdCard[]> {