mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-12 18:22:16 +01:00
fix 0 values do no update time entry, fix duplicate requests on time entry update
This commit is contained in:
@@ -37,14 +37,17 @@ watch(focused, (newValue, oldValue) => {
|
||||
updateTimeEntry();
|
||||
}
|
||||
});
|
||||
|
||||
const open = ref(false);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="relative">
|
||||
<Dropdown
|
||||
v-model="open"
|
||||
@submit="open = false"
|
||||
align="bottom"
|
||||
:close-on-content-click="false"
|
||||
@submit="updateTimeEntry">
|
||||
:close-on-content-click="false">
|
||||
<template #trigger>
|
||||
<button
|
||||
data-testid="time_entry_range_selector"
|
||||
|
||||
@@ -17,7 +17,7 @@ const minutes = computed(() => {
|
||||
function updateMinutes(event: Event) {
|
||||
const target = event.target as HTMLInputElement;
|
||||
const newValue = target.value;
|
||||
if (parseInt(newValue)) {
|
||||
if (!isNaN(parseInt(newValue))) {
|
||||
model.value = dayjs(model.value)
|
||||
.utc()
|
||||
.set('minutes', parseInt(newValue))
|
||||
@@ -28,7 +28,7 @@ function updateMinutes(event: Event) {
|
||||
function updateHours(event: Event) {
|
||||
const target = event.target as HTMLInputElement;
|
||||
const newValue = target.value;
|
||||
if (parseInt(newValue)) {
|
||||
if (!isNaN(parseInt(newValue))) {
|
||||
model.value = dayjs(model.value)
|
||||
.utc()
|
||||
.set('hours', parseInt(newValue))
|
||||
|
||||
Reference in New Issue
Block a user