mirror of
https://github.com/n8n-io/n8n.git
synced 2024-09-20 06:47:32 -07:00
fix(editor): Fix for logging error on user logout (#4633)
* 🐛 Fixing telemetry errors on user logout * 🔥 Removing call to `rudder.indentify` when users log out * 👌 Addressing review comment Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com> Co-authored-by: Mutasem Aldmour <4711238+mutdmour@users.noreply.github.com>
This commit is contained in:
parent
0daa36c197
commit
7483e147fc
|
@ -33,22 +33,19 @@ export default mixins(externalHooks).extend({
|
|||
telemetry(): ITelemetrySettings {
|
||||
return this.settingsStore.telemetry;
|
||||
},
|
||||
isTelemetryEnabled(): boolean {
|
||||
return !!this.telemetry?.enabled;
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.init();
|
||||
},
|
||||
methods: {
|
||||
init() {
|
||||
if (this.isTelemetryInitialized || !this.isTelemetryEnabledOnRoute) return;
|
||||
|
||||
const telemetrySettings = this.telemetry;
|
||||
|
||||
if (!telemetrySettings || !telemetrySettings.enabled) {
|
||||
return;
|
||||
}
|
||||
if (this.isTelemetryInitialized || !this.isTelemetryEnabledOnRoute || !this.isTelemetryEnabled) return;
|
||||
|
||||
this.$telemetry.init(
|
||||
telemetrySettings,
|
||||
this.telemetry,
|
||||
{
|
||||
instanceId: this.rootStore.instanceId,
|
||||
userId: this.currentUserId,
|
||||
|
@ -69,7 +66,9 @@ export default mixins(externalHooks).extend({
|
|||
this.init();
|
||||
},
|
||||
currentUserId(userId) {
|
||||
this.$telemetry.identify(this.rootStore.instanceId, userId);
|
||||
if (this.isTelemetryEnabled) {
|
||||
this.$telemetry.identify(this.rootStore.instanceId, userId);
|
||||
}
|
||||
this.$externalHooks().run('telemetry.currentUserIdChanged', {
|
||||
instanceId: this.rootStore.instanceId,
|
||||
userId,
|
||||
|
|
|
@ -87,7 +87,6 @@ export class Telemetry {
|
|||
}
|
||||
else {
|
||||
this.rudderStack.reset();
|
||||
this.rudderStack.identify(undefined, traits);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue