Merge branch 'main' of github.com:standardnotes/app

This commit is contained in:
Aman Harwara
2022-12-29 12:31:59 +05:30
30 changed files with 136 additions and 16 deletions

View File

@@ -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)