diff options
author | Ansh <anshnanda10@gmail.com> | 2023-08-24 16:13:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-24 16:13:42 -0700 |
commit | 7410bcd888dbf7010bccaa032893a45bfff7fa76 (patch) | |
tree | 320ea81b917a3fd4397afa141e2e79bf95d6e338 /src | |
parent | c6f321862bf0bb7006462b9c7b4b7e833a1d868c (diff) | |
download | voidsky-7410bcd888dbf7010bccaa032893a45bfff7fa76.tar.zst |
setup `isAuthenticatedUser` in profileUiModel inside an action (#1272)
Diffstat (limited to 'src')
-rw-r--r-- | src/state/models/ui/profile.ts | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/state/models/ui/profile.ts b/src/state/models/ui/profile.ts index 436ab313b..11951b0ee 100644 --- a/src/state/models/ui/profile.ts +++ b/src/state/models/ui/profile.ts @@ -1,4 +1,4 @@ -import {makeAutoObservable} from 'mobx' +import {makeAutoObservable, runInAction} from 'mobx' import {RootStoreModel} from '../root-store' import {ProfileModel} from '../content/profile' import {PostsFeedModel} from '../feeds/posts' @@ -228,8 +228,10 @@ export class ProfileUiModel { .setup() .catch(err => this.rootStore.log.error('Failed to fetch feed', err)), ]) - this.isAuthenticatedUser = - this.profile.did === this.rootStore.session.currentSession?.did + runInAction(() => { + this.isAuthenticatedUser = + this.profile.did === this.rootStore.session.currentSession?.did + }) this.algos.refresh() // HACK: need to use the DID as a param, not the username -prf this.lists.source = this.profile.did |