* 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:
parent
4515559b1a
commit
0ae52e91ce
4 changed files with 51 additions and 12 deletions
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue