* 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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user