force loading of items after switching to another event

This commit is contained in:
j3d1 2024-12-21 20:21:05 +01:00
parent b31f3758e0
commit e4fa48eb75

View file

@ -67,7 +67,7 @@
</template> </template>
<script> <script>
import {mapActions, mapGetters, mapMutations} from 'vuex'; import {mapActions, mapGetters, mapMutations, mapState} from 'vuex';
import Table from '@/components/Table'; import Table from '@/components/Table';
import Cards from '@/components/Cards'; import Cards from '@/components/Cards';
import Modal from '@/components/Modal'; import Modal from '@/components/Modal';
@ -83,7 +83,7 @@ export default {
}), }),
components: {AsyncLoader, AuthenticatedImage, Table, Cards, Modal}, components: {AsyncLoader, AuthenticatedImage, Table, Cards, Modal},
computed: { computed: {
...mapGetters(['getEventItems', 'isItemsLoaded', 'layout']), ...mapGetters(['getEventItems', 'isItemsLoaded', 'layout', 'getEventSlug']),
}, },
methods: { methods: {
...mapActions(['deleteItem', 'markItemReturned', 'loadEventItems', 'updateItem', 'scheduleAfterInit']), ...mapActions(['deleteItem', 'markItemReturned', 'loadEventItems', 'updateItem', 'scheduleAfterInit']),
@ -95,6 +95,11 @@ export default {
return window.confirm(message); return window.confirm(message);
} }
}, },
watch: {
getEventSlug() {
this.scheduleAfterInit(() => [this.loadEventItems()]);
}
},
mounted() { mounted() {
this.scheduleAfterInit(() => [this.loadEventItems()]); this.scheduleAfterInit(() => [this.loadEventItems()]);
} }