Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Commit

Permalink
do not save the displayExposureHistory if it is empty (#1618)
Browse files Browse the repository at this point in the history
  • Loading branch information
smcmurtry authored May 21, 2021
1 parent 68a74d5 commit 1f4ca6c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,11 @@ export class ExposureNotificationService {

public async saveDisplayExposureHistory() {
const displayExposureHistory = this.displayExposureHistory.get();
// don't save displayExposureHistory if it is empty,
// this is to avoid over-writing the history if it hasn't been loaded yet
if (displayExposureHistory.length === 0) {
return;
}
log.debug({category: 'debug', message: 'saving displayExposureHistory', payload: {displayExposureHistory}});
await this.storageService.save(
StorageDirectory.ExposureNotificationServiceDisplayExposureHistoryKey,
Expand Down

0 comments on commit 1f4ca6c

Please sign in to comment.