#984 Updating indexedAt timestamps (#1024)

* add TimeElapsed util component, integrate into PostThreadItem

* integrate into posts

* use consistent naming

* use mobx and single interval for TimeElapsed
This commit is contained in:
Eric Bailey 2023-07-19 12:16:57 -05:00 committed by GitHub
parent 4515559b1a
commit 0ae52e91ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 51 additions and 12 deletions

View file

@ -224,6 +224,7 @@ export class ShellUiModel {
activeLightbox: ProfileImageLightbox | ImagesLightbox | null = null
isComposerActive = false
composerOpts: ComposerOpts | undefined
tickEveryMinute = Date.now()
constructor(public rootStore: RootStoreModel) {
makeAutoObservable(this, {
@ -231,6 +232,8 @@ export class ShellUiModel {
rootStore: false,
hydrate: false,
})
this.setupClock()
}
serialize(): unknown {
@ -341,4 +344,10 @@ export class ShellUiModel {
this.isComposerActive = false
this.composerOpts = undefined
}
setupClock() {
setInterval(() => {
this.tickEveryMinute = Date.now()
}, 60_000)
}
}