fix #139
This commit is contained in:
parent
94d778ee34
commit
c96b599a86
1 changed files with 15 additions and 15 deletions
|
|
@ -25,15 +25,15 @@
|
|||
</main>
|
||||
</template>
|
||||
<script setup>
|
||||
import { ref } from "vue";
|
||||
import Intro from "../components/project/brief/Intro.vue";
|
||||
import ModeSelection from "../components/project/brief/ModeSelection.vue";
|
||||
import Images from "../components/project/brief/Images.vue";
|
||||
import TitledPdfWrapper from "../components/project/TitledPdfWrapper.vue";
|
||||
import { usePageStore } from "../stores/page";
|
||||
import { storeToRefs } from "pinia";
|
||||
import { useApiStore } from "../stores/api";
|
||||
import { useRoute } from "vue-router";
|
||||
import { ref } from 'vue';
|
||||
import Intro from '../components/project/brief/Intro.vue';
|
||||
import ModeSelection from '../components/project/brief/ModeSelection.vue';
|
||||
import Images from '../components/project/brief/Images.vue';
|
||||
import TitledPdfWrapper from '../components/project/TitledPdfWrapper.vue';
|
||||
import { usePageStore } from '../stores/page';
|
||||
import { storeToRefs } from 'pinia';
|
||||
import { useApiStore } from '../stores/api';
|
||||
import { useRoute } from 'vue-router';
|
||||
|
||||
const stepsComponents = {
|
||||
Intro,
|
||||
|
|
@ -52,21 +52,21 @@ function changeStep(stepName) {
|
|||
}
|
||||
|
||||
function setInitialStep() {
|
||||
if (useRoute().query.step === "images") {
|
||||
return "Images";
|
||||
if (useRoute().query.step === 'images') {
|
||||
return 'Images';
|
||||
}
|
||||
const hasPDF = page.value.content.pdf.length !== 0;
|
||||
const hasPDF = page.value?.content?.pdf?.length !== 0;
|
||||
const hasImages =
|
||||
page.value.content.moodboard.length !== 0 ||
|
||||
page.value.content.description.length !== 0;
|
||||
const isEmpty = !hasPDF && !hasImages;
|
||||
if (isEmpty) return "Intro";
|
||||
if (hasImages) return "Images";
|
||||
if (isEmpty) return 'Intro';
|
||||
if (hasImages) return 'Images';
|
||||
}
|
||||
|
||||
function validate() {
|
||||
api.validateBrief(page.value.uri).then((res) => {
|
||||
location.href = "/" + page.value.parent;
|
||||
location.href = '/' + page.value.parent;
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue