From 5466f475d4a40e6a498e7928a64b9256e5b82a07 Mon Sep 17 00:00:00 2001 From: Chocolate Pie <106949016+chocolate-pie@users.noreply.github.com> Date: Wed, 5 Jul 2023 08:14:25 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=E5=A4=89=E6=95=B0=E3=81=AE?= =?UTF-8?q?=E5=90=8D=E5=89=8D=E3=82=92=E5=A4=89=E6=9B=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../frontend/src/components/MkAbuseReportResolver.vue | 8 ++++---- packages/frontend/src/pages/admin/abuses.vue | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/frontend/src/components/MkAbuseReportResolver.vue b/packages/frontend/src/components/MkAbuseReportResolver.vue index cfe26f7ec5..a3a50b2ea0 100644 --- a/packages/frontend/src/components/MkAbuseReportResolver.vue +++ b/packages/frontend/src/components/MkAbuseReportResolver.vue @@ -56,7 +56,7 @@ const props = defineProps<{ expiresAt: string; forward: boolean; expirationDate: string; - beforeExpiresAt?: string; + previousExpiresAt?: string; } editable: boolean; data?: { @@ -67,7 +67,7 @@ const props = defineProps<{ expirationDate: string | null; expiresAt: string; forward: boolean; - beforeExpiresAt?: string; + previousExpiresAt?: string; } }>(); let expirationDate: string | null = $ref(null); @@ -88,7 +88,7 @@ const value = computed({ expirationDate: null, expiresAt: 'indefinitely', forward: false, - beforeExpiresAt: undefined, + previousExpiresAt: undefined, }; for (const [key, _value] of Object.entries(data)) { if (_value === null) { @@ -123,7 +123,7 @@ watch(() => value.value.expirationDate, () => renderExpirationDate(), { immediat watch(() => value.value.expiresAt, () => renderExpirationDate(true)); watch(() => props.editable, () => { if (props.editable) { - value.value.beforeExpiresAt = value.value.expiresAt; + value.value.previousExpiresAt = value.value.expiresAt; } }); diff --git a/packages/frontend/src/pages/admin/abuses.vue b/packages/frontend/src/pages/admin/abuses.vue index 87c8444b1d..b3d088acaf 100644 --- a/packages/frontend/src/pages/admin/abuses.vue +++ b/packages/frontend/src/pages/admin/abuses.vue @@ -123,7 +123,7 @@ let editingResolver = $ref<{ expiresAt: string; expirationDate: string; forward: boolean; - beforeExpiresAt?: string; + previousExpiresAt?: string; }>(defaultResolver); const pagination = { @@ -156,7 +156,7 @@ function save(): void { targetUserPattern: editingResolver.targetUserPattern || null, reporterPattern: editingResolver.reporterPattern || null, reportContentPattern: editingResolver.reportContentPattern || null, - ...(editingResolver.beforeExpiresAt && editingResolver.beforeExpiresAt === editingResolver.expiresAt ? {} : { + ...(editingResolver.previousExpiresAt && editingResolver.previousExpiresAt === editingResolver.expiresAt ? {} : { expiresAt: editingResolver.expiresAt, }), forward: editingResolver.forward,