mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
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:
@@ -397,19 +397,21 @@ export default {
|
|||||||
await this.$store.dispatch('worldState:getWorldState');
|
await this.$store.dispatch('worldState:getWorldState');
|
||||||
|
|
||||||
this.$root.$on('bv::show::modal', (modalId, data = {}) => {
|
this.$root.$on('bv::show::modal', (modalId, data = {}) => {
|
||||||
// We force reloading the world state every time the modal is reopened
|
if (modalId === 'buy-gems') {
|
||||||
// To make sure the promo status is always up to date
|
// We force reloading the world state every time the modal is reopened
|
||||||
this.$store.dispatch('worldState:getWorldState', { forceLoad: true });
|
// 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
|
// 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
|
// For example the gems button in the menu already tracks the event by itself
|
||||||
if (modalId === 'buy-gems' && data.alreadyTracked !== true) {
|
if (data.alreadyTracked !== true) {
|
||||||
Analytics.track({
|
Analytics.track({
|
||||||
hitType: 'event',
|
hitType: 'event',
|
||||||
eventCategory: 'button',
|
eventCategory: 'button',
|
||||||
eventAction: 'click',
|
eventAction: 'click',
|
||||||
eventLabel: 'Gems > Wallet',
|
eventLabel: 'Gems > Wallet',
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -114,9 +114,15 @@ module.exports = {
|
|||||||
options.quiet = true;
|
options.quiet = true;
|
||||||
return options;
|
return options;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Fix issue with Safari cache, see https://github.com/vuejs/vue-cli/issues/2509
|
||||||
|
if (process.env.NODE_ENV === 'development') {
|
||||||
|
config.plugins.delete('preload');
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
devServer: {
|
devServer: {
|
||||||
|
headers: { 'Cache-Control': 'no-store' },
|
||||||
disableHostCheck: true,
|
disableHostCheck: true,
|
||||||
proxy: {
|
proxy: {
|
||||||
// proxy all requests to the server at IP:PORT as specified in the top-level config
|
// proxy all requests to the server at IP:PORT as specified in the top-level config
|
||||||
|
|||||||
Reference in New Issue
Block a user