about summary refs log tree commit diff
path: root/src/state/models/ui/shell.ts
diff options
context:
space:
mode:
authorEric Bailey <git@esb.lol>2023-07-19 12:16:57 -0500
committerGitHub <noreply@github.com>2023-07-19 12:16:57 -0500
commit0ae52e91ceaf1af41f12bfa6e76c7d719be5e0e5 (patch)
treea395def20fc038da3f41920733d18f3a93b07541 /src/state/models/ui/shell.ts
parent4515559b1a7db493188cfe92abf8ea5cfd53c6dc (diff)
downloadvoidsky-0ae52e91ceaf1af41f12bfa6e76c7d719be5e0e5.tar.zst
#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
Diffstat (limited to 'src/state/models/ui/shell.ts')
-rw-r--r--src/state/models/ui/shell.ts9
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)
+  }
 }