add a confirm modal before resetting task record
This commit is contained in:
@@ -91,6 +91,12 @@ const addSteps = (steps: Stepable[]) => {
|
|||||||
taskStore.addStepsToTask(props.taskId, steps, record.value.currentStepId)
|
taskStore.addStepsToTask(props.taskId, steps, record.value.currentStepId)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const reset = () => {
|
||||||
|
if (window.confirm('Are you sure you want to reset the record?')) {
|
||||||
|
recordStore.reset(props.taskId)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
const activeElement = useActiveElement()
|
const activeElement = useActiveElement()
|
||||||
const INPUT_MATTERS = ['INPUT', 'TEXTAREA']
|
const INPUT_MATTERS = ['INPUT', 'TEXTAREA']
|
||||||
const notUsingInput = computed(
|
const notUsingInput = computed(
|
||||||
@@ -169,11 +175,7 @@ onUnmounted(() => {
|
|||||||
<img src="/icons/plus.svg" alt="plus" />
|
<img src="/icons/plus.svg" alt="plus" />
|
||||||
</button>
|
</button>
|
||||||
|
|
||||||
<button
|
<button v-if="hasStarted" class="button is-warning" @click="reset">
|
||||||
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