@salesforcedevs/dx-components 1.2.2-avatar-button-2 → 1.2.2-avatar-button-3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -118,17 +118,23 @@ export default class AvatarButton extends LightningElement {
|
|
|
118
118
|
this.platformEventsSubscribe();
|
|
119
119
|
this.requestUserInfo();
|
|
120
120
|
}
|
|
121
|
-
},
|
|
121
|
+
}, 3000);
|
|
122
122
|
} else {
|
|
123
123
|
if (this.isLoading) {
|
|
124
|
+
console.log('Subscribing to platform events!');
|
|
124
125
|
// This was a login.
|
|
125
|
-
this.platformEventsSubscribe();
|
|
126
|
+
setTimeout(() => this.platformEventsSubscribe(), 3000);
|
|
126
127
|
// this.trackLogin(); TODO: track only clicks
|
|
127
128
|
}
|
|
128
129
|
this.requestUserInfo();
|
|
129
130
|
}
|
|
130
131
|
}
|
|
131
132
|
|
|
133
|
+
renderedCallback() {
|
|
134
|
+
// TESTING
|
|
135
|
+
this.template.querySelector('img.avatar')?.addEventListener('click', this.platformEventsSubscribe);
|
|
136
|
+
}
|
|
137
|
+
|
|
132
138
|
disconnectedCallback() {
|
|
133
139
|
window.removeEventListener("tbid-login", this.handleSsoLogin);
|
|
134
140
|
window.removeEventListener("tbid-logout", this.handleSsoLogout);
|
|
@@ -192,6 +198,7 @@ export default class AvatarButton extends LightningElement {
|
|
|
192
198
|
};
|
|
193
199
|
|
|
194
200
|
private platformEventsSubscribe = () => {
|
|
201
|
+
console.log('platform events subscribe');
|
|
195
202
|
this.teardownEventSource();
|
|
196
203
|
this.setupEventSource();
|
|
197
204
|
};
|