diff options
author | Eric Bailey <git@esb.lol> | 2023-07-19 12:16:57 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-19 12:16:57 -0500 |
commit | 0ae52e91ceaf1af41f12bfa6e76c7d719be5e0e5 (patch) | |
tree | a395def20fc038da3f41920733d18f3a93b07541 /src/state/models/ui | |
parent | 4515559b1a7db493188cfe92abf8ea5cfd53c6dc (diff) | |
download | voidsky-0ae52e91ceaf1af41f12bfa6e76c7d719be5e0e5.tar.zst |
* add TimeElapsed util component, integrate into PostThreadItem * integrate into posts * use consistent naming * use mobx and single interval for TimeElapsed
Diffstat (limited to 'src/state/models/ui')
-rw-r--r-- | src/state/models/ui/shell.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/state/models/ui/shell.ts b/src/state/models/ui/shell.ts index a0e0cd7b2..1c069232c 100644 --- a/src/state/models/ui/shell.ts +++ b/src/state/models/ui/shell.ts @@ -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) + } } |