From bf76b25db6a73a9efbbcfd6c594d48c856d87ba5 Mon Sep 17 00:00:00 2001 From: kyle-ssg Date: Tue, 17 Sep 2024 17:50:12 +0100 Subject: [PATCH] Add fix from fix/race-condition-on-init-response --- flagsmith-core.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/flagsmith-core.ts b/flagsmith-core.ts index 423ab67..d99c939 100644 --- a/flagsmith-core.ts +++ b/flagsmith-core.ts @@ -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