diff --git a/frontend/src/components/Modals/EventModal.vue b/frontend/src/components/Modals/EventModal.vue index f01a24d0..4e1ea574 100644 --- a/frontend/src/components/Modals/EventModal.vue +++ b/frontend/src/components/Modals/EventModal.vue @@ -158,6 +158,7 @@ ? __('Duplicate') : __('Create') " + :disabled="!dirty" :loading=" mode === 'edit' ? eventsResource.setValue.loading @@ -224,6 +225,7 @@ const mode = computed(() => { : 'create' }) +const oldEvent = ref({}) const _event = ref({ title: '', description: '', @@ -239,6 +241,10 @@ const _event = ref({ event_participants: [], }) +const dirty = computed(() => { + return JSON.stringify(_event.value) !== JSON.stringify(oldEvent.value) +}) + const peoples = computed({ get() { return _event.value.event_participants || [] @@ -274,6 +280,8 @@ onMounted(() => { event_participants: props.event.event_participants || [], } + oldEvent.value = JSON.parse(JSON.stringify(_event.value)) + setTimeout(() => title.value?.el?.focus(), 100) } })