Browse Source

refactor: switched WhatIsNew modal to new vuex helper for modal state

Kristian Vos 2 years ago
parent
commit
2792e8d65d
1 changed files with 6 additions and 6 deletions
  1. 6 6
      frontend/src/components/modals/WhatIsNew.vue

+ 6 - 6
frontend/src/components/modals/WhatIsNew.vue

@@ -1,22 +1,22 @@
 <script setup lang="ts">
 import { useStore } from "vuex";
-import { computed, onMounted, onBeforeUnmount } from "vue";
+import { onMounted, onBeforeUnmount } from "vue";
 
 import { formatDistance } from "date-fns";
 import { marked } from "marked";
 import dompurify from "dompurify";
 
+import { useModalState } from "@/vuex_helpers";
+
 const store = useStore();
 
 const props = defineProps({
 	modalUuid: { type: String, default: "" }
 });
 
-const news = computed(() =>
-	store.state.modals.whatIsNew[props.modalUuid]
-		? store.state.modals.whatIsNew[props.modalUuid].news
-		: {}
-);
+const { news } = useModalState("modals/whatIsNew/MODAL_UUID", {
+	modalUuid: props.modalUuid
+});
 
 onMounted(() => {
 	marked.use({