diff --git a/packages/web/src/javascripts/Controllers/Moments/MomentsService.ts b/packages/web/src/javascripts/Controllers/Moments/MomentsService.ts index 5c4aef7a5..12db2ed3b 100644 --- a/packages/web/src/javascripts/Controllers/Moments/MomentsService.ts +++ b/packages/web/src/javascripts/Controllers/Moments/MomentsService.ts @@ -29,11 +29,13 @@ export class MomentsService extends AbstractViewController { void this.beginTakingPhotos() } }, ApplicationEvent.LocalDataLoaded), + application.addEventObserver(async () => { - this.disableMoments() + this.pauseMoments() }, ApplicationEvent.BiometricsSoftLockEngaged), + application.addEventObserver(async () => { - this.enableMoments() + this.resumeMoments() }, ApplicationEvent.BiometricsSoftLockDisengaged), ) @@ -67,6 +69,18 @@ export class MomentsService extends AbstractViewController { clearInterval(this.intervalReference) } + private pauseMoments(): void { + clearInterval(this.intervalReference) + } + + private resumeMoments(): void { + if (!this.isEnabled) { + return + } + + void this.beginTakingPhotos() + } + private beginTakingPhotos() { if (this.intervalReference) { clearInterval(this.intervalReference)