mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 23:27:26 +01:00
fix(analytics): move lfp events out of mounted
This commit is contained in:
@@ -264,12 +264,6 @@ export default {
|
||||
},
|
||||
mounted () {
|
||||
this.seeking = Boolean(this.user.party.seeking);
|
||||
Analytics.track({
|
||||
eventName: 'Start a Party button',
|
||||
eventAction: 'Start a Party button',
|
||||
eventCategory: 'behavior',
|
||||
hitType: 'event',
|
||||
}, { trackOnClient: true });
|
||||
},
|
||||
methods: {
|
||||
async createParty () {
|
||||
|
||||
@@ -243,8 +243,6 @@ import rogueIcon from '@/assets/svg/rogue.svg';
|
||||
import healerIcon from '@/assets/svg/healer.svg';
|
||||
import wizardIcon from '@/assets/svg/wizard.svg';
|
||||
|
||||
import * as Analytics from '@/libs/analytics';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
Avatar,
|
||||
@@ -287,12 +285,6 @@ export default {
|
||||
section: this.$t('lookingForPartyTitle'),
|
||||
});
|
||||
this.seekers = await this.$store.dispatch('party:lookingForParty');
|
||||
await Analytics.track({
|
||||
hitType: 'event',
|
||||
eventName: 'View Find Members',
|
||||
eventAction: 'View Find Members',
|
||||
eventCategory: 'behavior',
|
||||
}, { trackOnClient: true });
|
||||
this.canLoadMore = this.seekers.length === 30;
|
||||
this.loading = false;
|
||||
}
|
||||
|
||||
@@ -122,6 +122,7 @@
|
||||
|
||||
<script>
|
||||
import orderBy from 'lodash/orderBy';
|
||||
import * as Analytics from '@/libs/analytics';
|
||||
import { mapGetters, mapActions } from '@/libs/store';
|
||||
import MemberDetails from '../memberDetails';
|
||||
import createPartyModal from '../groups/createPartyModal';
|
||||
@@ -237,6 +238,12 @@ export default {
|
||||
this.$router.push('/looking-for-party');
|
||||
} else {
|
||||
this.$root.$emit('bv::show::modal', 'create-party-modal');
|
||||
Analytics.track({
|
||||
eventName: 'Start a Party button',
|
||||
eventAction: 'Start a Party button',
|
||||
eventCategory: 'behavior',
|
||||
hitType: 'event',
|
||||
}, { trackOnClient: true });
|
||||
}
|
||||
},
|
||||
loadMembers (payload = null) {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import Vue from 'vue';
|
||||
import VueRouter from 'vue-router';
|
||||
import * as Analytics from '@/libs/analytics';
|
||||
import getStore from '@/store';
|
||||
import handleRedirect from './handleRedirect';
|
||||
|
||||
@@ -439,6 +440,15 @@ router.beforeEach(async (to, from, next) => {
|
||||
router.app.$root.$emit('update-party');
|
||||
}
|
||||
|
||||
if (to.name === 'lookingForParty') {
|
||||
Analytics.track({
|
||||
hitType: 'event',
|
||||
eventName: 'View Find Members',
|
||||
eventAction: 'View Find Members',
|
||||
eventCategory: 'behavior',
|
||||
}, { trackOnClient: true });
|
||||
}
|
||||
|
||||
// Redirect old guild urls
|
||||
if (to.hash.indexOf('#/options/groups/guilds/') !== -1) {
|
||||
const splits = to.hash.split('/');
|
||||
|
||||
Reference in New Issue
Block a user