disable optimization request btn if already sent
This commit is contained in:
parent
77a0a42606
commit
c73b9d671b
7 changed files with 114 additions and 81 deletions
|
|
@ -21,15 +21,22 @@
|
|||
class="order-last | text-sm text-primary font-medium"
|
||||
>
|
||||
{{ images[0].comments.length }} commentaire{{
|
||||
images[0].comments.length > 1 ? "s" : ""
|
||||
images[0].comments.length > 1 ? 's' : ''
|
||||
}}
|
||||
</footer>
|
||||
<div class="btn btn--xs btn--dtl | mt-16" v-if="isDesignToLightStep(step)" data-icon="leaf" lang="en">Design to Light</div>
|
||||
<div
|
||||
class="btn btn--xs btn--dtl | mt-16"
|
||||
v-if="isDesignToLightStep(step)"
|
||||
data-icon="leaf"
|
||||
lang="en"
|
||||
>
|
||||
Design to Light
|
||||
</div>
|
||||
</article>
|
||||
</template>
|
||||
<script setup>
|
||||
import DateTime from "./DateTime.vue";
|
||||
import { useDesignToLightStore } from "../../../stores/designToLight";
|
||||
import DateTime from './DateTime.vue';
|
||||
import { useDesignToLightStore } from '../../../stores/designToLight';
|
||||
|
||||
const { images, step, uri } = defineProps({
|
||||
images: Array,
|
||||
|
|
|
|||
|
|
@ -7,31 +7,39 @@
|
|||
/>
|
||||
</template>
|
||||
<script setup>
|
||||
import Images from "./Images.vue";
|
||||
import { computed } from "vue";
|
||||
import Images from './Images.vue';
|
||||
import { computed } from 'vue';
|
||||
const { step } = defineProps({ step: Object });
|
||||
|
||||
const images = computed(() => {
|
||||
if (!step.files.dynamic) {
|
||||
return [
|
||||
{
|
||||
url: step.files.static.rawGlass.cover,
|
||||
url: step.files?.static?.rawGlass?.cover,
|
||||
},
|
||||
{
|
||||
url: step.files?.static?.finishedGlass?.cover,
|
||||
},
|
||||
];
|
||||
}
|
||||
return step.files?.dynamic?.map((track) => getFrontView(track)) ?? [];
|
||||
|
||||
return (
|
||||
step.files?.dynamic?.map(
|
||||
(track) => (getFrontView(track)['dynamic'] = true)
|
||||
) ?? []
|
||||
);
|
||||
});
|
||||
|
||||
const uri = "/" + step.uri;
|
||||
const uri = '/' + step.uri;
|
||||
|
||||
function getFrontView(track) {
|
||||
if (track.files.length === 1) return track.files[0];
|
||||
const xMax = parseInt(
|
||||
track.files[track.files.length - 1].name.split("_")[1].split(".")[0]
|
||||
track.files[track.files.length - 1].name.split('_')[1].split('.')[0]
|
||||
);
|
||||
const xFrontView = (xMax + 1) / 2;
|
||||
const extension = track.files[0].name.split(".")[1];
|
||||
const frontViewName = "0_" + xFrontView + "." + extension;
|
||||
const extension = track.files[0].name.split('.')[1];
|
||||
const frontViewName = '0_' + xFrontView + '.' + extension;
|
||||
const frontView = track.files.find((file) => file.name === frontViewName);
|
||||
return frontView;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue