diff --git a/services/webui/src/app/components/mixins/MovieListComponentMixin.ts b/services/webui/src/app/components/mixins/MovieListComponentMixin.ts index 2bbf761..c0d083d 100644 --- a/services/webui/src/app/components/mixins/MovieListComponentMixin.ts +++ b/services/webui/src/app/components/mixins/MovieListComponentMixin.ts @@ -1,5 +1,5 @@ import { IMovie } from "@autoplex-api/request"; -import { Mutation } from "../../store"; +import { Action, Mutation } from "../../store"; import { defineComponent } from "vue"; export default defineComponent({ @@ -20,12 +20,7 @@ export default defineComponent({ }, watch: { movies(newValue, oldValue) { - if (newValue.length > 0) { - this.$store.commit(Mutation.StoreMovies, newValue); - } - if (oldValue.length > 0) { - this.$store.commit(Mutation.FreeMovies, oldValue); - } + this.$store.dispatch(Action.UpdateMovies, { newValue, oldValue }); } } })