mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-04-08 02:52:39 -05:00
This reverts commit c32ee3ca40
.
- I found another way to fix this, making this change unnecessary
This commit is contained in:
parent
c32ee3ca40
commit
59076d1bca
3 changed files with 2 additions and 25 deletions
|
@ -1,8 +1,8 @@
|
|||
import Component from '@glimmer/component';
|
||||
import trackEvent from '../utils/analytics';
|
||||
import {action} from '@ember/object';
|
||||
import {inject} from 'ghost-admin/decorators/inject';
|
||||
import {inject as service} from '@ember/service';
|
||||
import {trackEvent} from '../utils/analytics';
|
||||
import {tracked} from '@glimmer/tracking';
|
||||
|
||||
export default class KoenigImageEditor extends Component {
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import Route from '@ember/routing/route';
|
||||
import {loadToolbar} from '../utils/analytics';
|
||||
import {inject as service} from '@ember/service';
|
||||
|
||||
export default class HomeRoute extends Route {
|
||||
|
@ -10,8 +9,6 @@ export default class HomeRoute extends Route {
|
|||
beforeModel(transition) {
|
||||
super.beforeModel(...arguments);
|
||||
|
||||
loadToolbar();
|
||||
|
||||
if (transition.to?.queryParams?.firstStart === 'true') {
|
||||
return this.router.transitionTo('setup.done');
|
||||
}
|
||||
|
|
|
@ -1,28 +1,8 @@
|
|||
// Wrapper function for Plausible event
|
||||
|
||||
export function trackEvent(eventName, props = {}) {
|
||||
export default function trackEvent(eventName, props = {}) {
|
||||
window.plausible = window.plausible || function () {
|
||||
(window.plausible.q = window.plausible.q || []).push(arguments);
|
||||
};
|
||||
window.plausible(eventName, {props: props});
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the PostHog toolbar if available
|
||||
* window.posthog must be available for this to do anything
|
||||
* This function needs to be called before the Admin App is fully initialized
|
||||
* because the Admin App overwrites the #__posthog hash with its own routing
|
||||
* before the PostHog snippet can read it and load the toolbar itself.
|
||||
* @returns {void}
|
||||
*/
|
||||
export function loadToolbar() {
|
||||
try {
|
||||
const toolbarJSON = new URLSearchParams(window.location.hash.substring(1)).get('__posthog');
|
||||
if (toolbarJSON && window.posthog) {
|
||||
window.posthog.loadToolbar(JSON.parse(toolbarJSON));
|
||||
}
|
||||
} catch (e) {
|
||||
// fail silently
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue