From a7991ce7dd8b70b665f3b0d87182f75e231f5016 Mon Sep 17 00:00:00 2001 From: Marius Andra Date: Tue, 14 Sep 2021 12:29:23 +0200 Subject: [PATCH] Do not load toobar only if autocapture enabled (#285) --- src/__tests__/autocapture.js | 6 ------ src/autocapture.js | 1 - src/posthog-core.js | 1 + 3 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/__tests__/autocapture.js b/src/__tests__/autocapture.js index 9e7223ba4..7fc0867dc 100644 --- a/src/__tests__/autocapture.js +++ b/src/__tests__/autocapture.js @@ -897,12 +897,6 @@ describe('Autocapture system', () => { jest.spyOn(autocapture, '_addDomEventHandlers') }) - - it('should check whether to load the editor', () => { - given.subject() - - expect(given.lib.toolbar.maybeLoadEditor).toHaveBeenCalled() - }) }) describe('afterDecideResponse()', () => { diff --git a/src/autocapture.js b/src/autocapture.js index 7a1d9f8d9..5003db738 100644 --- a/src/autocapture.js +++ b/src/autocapture.js @@ -231,7 +231,6 @@ var autocapture = { _customProperties: {}, init: function (instance) { - instance.toolbar.maybeLoadEditor() this.rageclicks = new RageClick(instance) }, diff --git a/src/posthog-core.js b/src/posthog-core.js index ff56f34f2..1bbaeb92d 100644 --- a/src/posthog-core.js +++ b/src/posthog-core.js @@ -142,6 +142,7 @@ var create_mplib = function (token, config, name) { instance.feature_flags = instance.featureFlags instance.toolbar = new Toolbar(instance) + instance.toolbar.maybeLoadEditor() instance.sessionRecording = new SessionRecording(instance) instance.sessionRecording.startRecordingIfEnabled()