Invalidate profiles cache on direct load
parent
0d70a09777
commit
5d7f3e1863
|
@ -140,6 +140,7 @@ export class ProfileViewModel {
|
||||||
const res = await this.rootStore.api.app.bsky.actor.getProfile(
|
const res = await this.rootStore.api.app.bsky.actor.getProfile(
|
||||||
this.params,
|
this.params,
|
||||||
)
|
)
|
||||||
|
this.rootStore.profiles.overwrite(this.params.actor, res) // cache invalidation
|
||||||
this._replaceAll(res)
|
this._replaceAll(res)
|
||||||
this._xIdle()
|
this._xIdle()
|
||||||
} catch (e: any) {
|
} catch (e: any) {
|
||||||
|
|
|
@ -41,4 +41,10 @@ export class ProfilesViewModel {
|
||||||
throw e
|
throw e
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
overwrite(did: string, res: GetProfile.Response) {
|
||||||
|
if (this.cache.has(did)) {
|
||||||
|
this.cache.set(did, res)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue