wrap interval in runInAction (#1037)

zio/stable
Eric Bailey 2023-07-19 14:24:35 -05:00 committed by GitHub
parent 0ae52e91ce
commit 302490cb31
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -1,6 +1,6 @@
import {AppBskyEmbedRecord} from '@atproto/api' import {AppBskyEmbedRecord} from '@atproto/api'
import {RootStoreModel} from '../root-store' import {RootStoreModel} from '../root-store'
import {makeAutoObservable} from 'mobx' import {makeAutoObservable, runInAction} from 'mobx'
import {ProfileModel} from '../content/profile' import {ProfileModel} from '../content/profile'
import {isObj, hasProp} from 'lib/type-guards' import {isObj, hasProp} from 'lib/type-guards'
import {Image as RNImage} from 'react-native-image-crop-picker' import {Image as RNImage} from 'react-native-image-crop-picker'
@ -347,7 +347,9 @@ export class ShellUiModel {
setupClock() { setupClock() {
setInterval(() => { setInterval(() => {
runInAction(() => {
this.tickEveryMinute = Date.now() this.tickEveryMinute = Date.now()
})
}, 60_000) }, 60_000)
} }
} }