Skip to content

Commit b0dfd1f

Browse files
boehlerlukasclaude
andcommitted
fix(226492): resend identify when the page language changed
Gleap.identify / updateContact skipped the request when the user data was unchanged, without comparing the active language. Apps that switch language without a full reload (Turbo, SPAs updating <html lang>) re-identify with the same data, so the contact's language in Gleap never updated and language-targeted outreach used the old language. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent e8dfcb9 commit b0dfd1f

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

‎src/GleapSession.js‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,13 @@ export default class GleapSession {
554554
};
555555

556556
checkIfSessionDataNeedsUpdate = (userData) => {
557+
// Every identify / update sends the active language, so a language switch
558+
// in the app (an <html lang> change in an SPA, setLanguage) must not be
559+
// skipped as "nothing changed".
560+
if (this.session && this.session.lang && this.session.lang !== GleapTranslationManager.getInstance().getActiveLanguage()) {
561+
return true;
562+
}
563+
557564
if (userData) {
558565
var userDataKeys = Object.keys(userData);
559566
for (var i = 0; i < userDataKeys.length; i++) {

0 commit comments

Comments
 (0)