Skip to content

Commit c2dd76f

Browse files
committed
fix: use boot() for Intercom reinit after shutdown, bump web-components
After shutdown(), messenger() internally calls update() instead of boot(), leaving the session broken. Track script loading separately from session state so boot() is always used after first init. Also bumps web-components from v2.0.56 to v2.0.58.
1 parent 1b34d2b commit c2dd76f

3 files changed

Lines changed: 6 additions & 7 deletions

File tree

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"vue": "^3.5.24",
4848
"vue-i18n": "11.2.8",
4949
"vue-router": "^4.6.3",
50-
"web-components": "github:nolus-protocol/web-components#v2.0.56",
50+
"web-components": "github:nolus-protocol/web-components#v2.0.58",
5151
"zod": "^4.3.6"
5252
},
5353
"devDependencies": {

src/common/utils/IntercomService.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ import { BackendApi } from "@/common/api";
1515
* 4. Frontend calls disconnect() on wallet disconnect
1616
*/
1717
class IntercomServiceClass {
18-
private loaded = false;
18+
private scriptLoaded = false;
1919
private currentWallet: string | null = null;
2020

2121
/**
@@ -35,11 +35,11 @@ class IntercomServiceClass {
3535
intercom_user_jwt: data.token
3636
};
3737

38-
if (this.loaded) {
38+
if (this.scriptLoaded) {
3939
boot(baseData);
4040
} else {
4141
messenger(baseData);
42-
this.loaded = true;
42+
this.scriptLoaded = true;
4343
}
4444

4545
return true;
@@ -54,7 +54,6 @@ class IntercomServiceClass {
5454
*/
5555
async disconnect(): Promise<void> {
5656
shutdown();
57-
this.loaded = false;
5857
this.currentWallet = null;
5958

6059
await new Promise((resolve) => setTimeout(resolve, 100));
@@ -80,7 +79,7 @@ class IntercomServiceClass {
8079
* Check if Intercom is loaded
8180
*/
8281
isLoaded(): boolean {
83-
return this.loaded;
82+
return this.scriptLoaded;
8483
}
8584

8685
/**

0 commit comments

Comments
 (0)