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