fix: make sure world state is not loaded every time a modal is opened, fix dev server caching on safari

This commit is contained in:
Matteo Pagliazzi
2020-11-13 14:33:59 +01:00
parent a863e79214
commit 41de90e578
2 changed files with 20 additions and 12 deletions
@@ -397,19 +397,21 @@ export default {
await this.$store.dispatch('worldState:getWorldState');
this.$root.$on('bv::show::modal', (modalId, data = {}) => {
// We force reloading the world state every time the modal is reopened
// To make sure the promo status is always up to date
this.$store.dispatch('worldState:getWorldState', { forceLoad: true });
if (modalId === 'buy-gems') {
// We force reloading the world state every time the modal is reopened
// To make sure the promo status is always up to date
this.$store.dispatch('worldState:getWorldState', { forceLoad: true });
// Track opening of gems modal unless it's been already tracked
// For example the gems button in the menu already tracks the event by itself
if (modalId === 'buy-gems' && data.alreadyTracked !== true) {
Analytics.track({
hitType: 'event',
eventCategory: 'button',
eventAction: 'click',
eventLabel: 'Gems > Wallet',
});
// Track opening of gems modal unless it's been already tracked
// For example the gems button in the menu already tracks the event by itself
if (data.alreadyTracked !== true) {
Analytics.track({
hitType: 'event',
eventCategory: 'button',
eventAction: 'click',
eventLabel: 'Gems > Wallet',
});
}
}
});
},