From 046f2435b2edd6adffaf4f45bb30114d52e62b6b Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E3=81=8B=E3=81=A3=E3=81=93=E3=81=8B=E3=82=8A?=
<67428053+kakkokari-gtyih@users.noreply.github.com>
Date: Sun, 11 Aug 2024 11:17:56 +0900
Subject: [PATCH] =?UTF-8?q?fix(frontend):=20mCaptcha=E3=82=92=E4=BD=BF?=
=?UTF-8?q?=E7=94=A8=E3=81=97=E3=81=A6=E3=81=84=E3=81=A6=E3=82=82bot?=
=?UTF-8?q?=E3=83=97=E3=83=AD=E3=83=86=E3=82=AF=E3=82=B7=E3=83=A7=E3=83=B3?=
=?UTF-8?q?=E3=81=AB=E9=96=A2=E3=81=99=E3=82=8B=E8=AD=A6=E5=91=8A=E3=81=8C?=
=?UTF-8?q?=E6=B6=88=E3=81=88=E3=81=AA=E3=81=84=E3=81=AE=E3=82=92=E4=BF=AE?=
=?UTF-8?q?=E6=AD=A3=20(#14390)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
* fix(frontend): mCaptchaを使用していてもbotプロテクションに関する警告が消えないのを修正
* Update Changelog
* refactor
---
CHANGELOG.md | 1 +
packages/frontend/src/pages/admin/index.vue | 31 +++++++++----------
.../frontend/src/pages/settings/index.vue | 3 --
3 files changed, 15 insertions(+), 20 deletions(-)
diff --git a/CHANGELOG.md b/CHANGELOG.md
index d2ce0906e2..8d5d228d17 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,6 +9,7 @@
- Fix: Play編集時に公開範囲が「パブリック」にリセットされる問題を修正
- Fix: ページ遷移に失敗することがある問題を修正
- Fix: iOSでユーザー名などがリンクとして誤検知される現象を抑制
+- Fix: mCaptchaを使用していてもbotプロテクションに関する警告が消えないのを修正
### Server
- Fix: WSの`readAllNotifications` メッセージが `body` を持たない場合に動作しない問題 #14374
diff --git a/packages/frontend/src/pages/admin/index.vue b/packages/frontend/src/pages/admin/index.vue
index 292f10da1a..40dec55deb 100644
--- a/packages/frontend/src/pages/admin/index.vue
+++ b/packages/frontend/src/pages/admin/index.vue
@@ -7,7 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+
@@ -61,10 +61,10 @@ const narrow = ref(false);
const view = ref(null);
const el = ref
(null);
const pageProps = ref({});
-let noMaintainerInformation = isEmpty(instance.maintainerName) || isEmpty(instance.maintainerEmail);
-let noBotProtection = !instance.disableRegistration && !instance.enableHcaptcha && !instance.enableRecaptcha && !instance.enableTurnstile;
-let noEmailServer = !instance.enableEmail;
-let noInquiryUrl = isEmpty(instance.inquiryUrl);
+const noMaintainerInformation = computed(() => isEmpty(instance.maintainerName) || isEmpty(instance.maintainerEmail));
+const noBotProtection = computed(() => !instance.disableRegistration && !instance.enableHcaptcha && !instance.enableRecaptcha && !instance.enableTurnstile && !instance.enableMcaptcha);
+const noEmailServer = computed(() => !instance.enableEmail);
+const noInquiryUrl = computed(() => isEmpty(instance.inquiryUrl));
const thereIsUnresolvedAbuseReport = ref(false);
const currentPage = computed(() => router.currentRef.value.child);
@@ -235,25 +235,22 @@ const menuDef = computed(() => [{
}],
}]);
-watch(narrow.value, () => {
- if (currentPage.value?.route.name == null && !narrow.value) {
- router.push('/admin/overview');
- }
-});
-
onMounted(() => {
- ro.observe(el.value);
-
- narrow.value = el.value.offsetWidth < NARROW_THRESHOLD;
+ if (el.value != null) {
+ ro.observe(el.value);
+ narrow.value = el.value.offsetWidth < NARROW_THRESHOLD;
+ }
if (currentPage.value?.route.name == null && !narrow.value) {
- router.push('/admin/overview');
+ router.replace('/admin/overview');
}
});
onActivated(() => {
- narrow.value = el.value.offsetWidth < NARROW_THRESHOLD;
+ if (el.value != null) {
+ narrow.value = el.value.offsetWidth < NARROW_THRESHOLD;
+ }
if (currentPage.value?.route.name == null && !narrow.value) {
- router.push('/admin/overview');
+ router.replace('/admin/overview');
}
});
diff --git a/packages/frontend/src/pages/settings/index.vue b/packages/frontend/src/pages/settings/index.vue
index 5fc1fd1bca..7d16740a3e 100644
--- a/packages/frontend/src/pages/settings/index.vue
+++ b/packages/frontend/src/pages/settings/index.vue
@@ -198,9 +198,6 @@ const menuDef = computed(() => [{
}],
}]);
-watch(narrow, () => {
-});
-
onMounted(() => {
ro.observe(el.value);