💄 (record) hide recycle button when there is no record yet

This commit is contained in:
Julien Calixte
2023-05-08 15:02:12 +02:00
parent 541a3d9c13
commit 2c49f5abf8

View File

@@ -42,12 +42,12 @@ const getNextStepId = () => {
return null
}
const canStart = computed(
() =>
!recordStore.currentStepId &&
Object.values(record.value?.stepRecords ?? {}).length === 0
const hasStarted = computed(
() => Object.values(record.value?.stepRecords ?? {}).length > 0
)
const canStart = computed(() => !recordStore.currentStepId && !hasStarted.value)
const startRecording = () => {
if (!canStart.value || !task.value) {
return
@@ -142,7 +142,11 @@ onUnmounted(() => {
</button>
</template>
<button class="button is-warning" @click="recordStore.reset(taskId)">
<button
v-if="hasStarted"
class="button is-warning"
@click="recordStore.reset(taskId)"
>
<img src="/icons/recycle.svg" alt="reset" />
</button>
</div>