diff --git a/packages/frontend/src/components/MkAbuseReportResolver.vue b/packages/frontend/src/components/MkAbuseReportResolver.vue index 3cf498f715..b970032d49 100644 --- a/packages/frontend/src/components/MkAbuseReportResolver.vue +++ b/packages/frontend/src/components/MkAbuseReportResolver.vue @@ -56,6 +56,7 @@ const props = defineProps<{ expiresAt: string; forward: boolean; expirationDate: string; + beforeExpiresAt?: string; } editable: boolean; data?: { @@ -77,9 +78,6 @@ const emit = defineEmits(['update:modelValue']); const value = computed({ get() { - if (props.modelValue && props.editable) { - emit('update:modelValue', props.data ?? props.modelValue); - } const data = props.data ?? props.modelValue ?? { name: '', targetUserPattern: '', @@ -93,6 +91,9 @@ const value = computed({ data[key] = ''; } } + if (props.modelValue && props.editable) { + emit('update:modelValue', data); + } return data as unknown as Exclude, undefined>; }, set(updateValue) { @@ -116,6 +117,11 @@ function renderExpirationDate(empty = false) { watch(() => value.value.expirationDate, () => renderExpirationDate(), { immediate: true }); watch(() => value.value.expiresAt, () => renderExpirationDate(true)); +watch(() => props.editable, () => { + if (props.editable) { + value.value.beforeExpiresAt = value.value.expiresAt; + } +});