💄 (record) hide recycle button when there is no record yet
This commit is contained in:
@@ -42,12 +42,12 @@ const getNextStepId = () => {
|
|||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
const canStart = computed(
|
const hasStarted = computed(
|
||||||
() =>
|
() => Object.values(record.value?.stepRecords ?? {}).length > 0
|
||||||
!recordStore.currentStepId &&
|
|
||||||
Object.values(record.value?.stepRecords ?? {}).length === 0
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
const canStart = computed(() => !recordStore.currentStepId && !hasStarted.value)
|
||||||
|
|
||||||
const startRecording = () => {
|
const startRecording = () => {
|
||||||
if (!canStart.value || !task.value) {
|
if (!canStart.value || !task.value) {
|
||||||
return
|
return
|
||||||
@@ -142,7 +142,11 @@ onUnmounted(() => {
|
|||||||
</button>
|
</button>
|
||||||
</template>
|
</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" />
|
<img src="/icons/recycle.svg" alt="reset" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user