This commit is contained in:
isUnknown 2025-03-12 18:42:52 +01:00
parent 94d778ee34
commit c96b599a86

View file

@ -25,15 +25,15 @@
</main> </main>
</template> </template>
<script setup> <script setup>
import { ref } from "vue"; import { ref } from 'vue';
import Intro from "../components/project/brief/Intro.vue"; import Intro from '../components/project/brief/Intro.vue';
import ModeSelection from "../components/project/brief/ModeSelection.vue"; import ModeSelection from '../components/project/brief/ModeSelection.vue';
import Images from "../components/project/brief/Images.vue"; import Images from '../components/project/brief/Images.vue';
import TitledPdfWrapper from "../components/project/TitledPdfWrapper.vue"; import TitledPdfWrapper from '../components/project/TitledPdfWrapper.vue';
import { usePageStore } from "../stores/page"; import { usePageStore } from '../stores/page';
import { storeToRefs } from "pinia"; import { storeToRefs } from 'pinia';
import { useApiStore } from "../stores/api"; import { useApiStore } from '../stores/api';
import { useRoute } from "vue-router"; import { useRoute } from 'vue-router';
const stepsComponents = { const stepsComponents = {
Intro, Intro,
@ -52,21 +52,21 @@ function changeStep(stepName) {
} }
function setInitialStep() { function setInitialStep() {
if (useRoute().query.step === "images") { if (useRoute().query.step === 'images') {
return "Images"; return 'Images';
} }
const hasPDF = page.value.content.pdf.length !== 0; const hasPDF = page.value?.content?.pdf?.length !== 0;
const hasImages = const hasImages =
page.value.content.moodboard.length !== 0 || page.value.content.moodboard.length !== 0 ||
page.value.content.description.length !== 0; page.value.content.description.length !== 0;
const isEmpty = !hasPDF && !hasImages; const isEmpty = !hasPDF && !hasImages;
if (isEmpty) return "Intro"; if (isEmpty) return 'Intro';
if (hasImages) return "Images"; if (hasImages) return 'Images';
} }
function validate() { function validate() {
api.validateBrief(page.value.uri).then((res) => { api.validateBrief(page.value.uri).then((res) => {
location.href = "/" + page.value.parent; location.href = '/' + page.value.parent;
}); });
} }
</script> </script>