Skip to content

Commit

Permalink
Add fix from fix/race-condition-on-init-response
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle-ssg authored and khvn26 committed Sep 19, 2024
1 parent 673fe91 commit bf76b25
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions flagsmith-core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@ const Flagsmith = class {
isFetching: true
})
}
const previousIdentity = `${this.identity}`;
const previousIdentity = `${this.getContext().identity}`;
const handleResponse = (response: IFlagsmithResponse | null) => {
if(!response || previousIdentity !== `${this.identity}`) {
if(!response || previousIdentity !== `${this.getContext().identity}`) {
return // getJSON returned null due to request/response mismatch
}
let { flags: features, traits, identifier }: IFlagsmithResponse = response
Expand Down

0 comments on commit bf76b25

Please sign in to comment.