Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(frontend): mCaptchaを使用していてもbotプロテクションに関する警告が消えないのを修正 #14390

Merged
merged 3 commits into from
Aug 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
- Fix: Play編集時に公開範囲が「パブリック」にリセットされる問題を修正
- Fix: ページ遷移に失敗することがある問題を修正
- Fix: iOSでユーザー名などがリンクとして誤検知される現象を抑制
- Fix: mCaptchaを使用していてもbotプロテクションに関する警告が消えないのを修正

### Server
- Fix: WSの`readAllNotifications` メッセージが `body` を持たない場合に動作しない問題 #14374
Expand Down
31 changes: 14 additions & 17 deletions packages/frontend/src/pages/admin/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div ref="el" class="hiyeyicy" :class="{ wide: !narrow }">
<div v-if="!narrow || currentPage?.route.name == null" class="nav">
<MkSpacer :contentMax="700" :marginMin="16">
<div class="lxpfedzu">
<div class="lxpfedzu _gaps">
<div class="banner">
<img :src="instance.iconUrl || '/favicon.ico'" alt="" class="icon"/>
</div>
Expand Down Expand Up @@ -61,10 +61,10 @@ const narrow = ref(false);
const view = ref(null);
const el = ref<HTMLDivElement | null>(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);

Expand Down Expand Up @@ -235,25 +235,22 @@ const menuDef = computed(() => [{
}],
}]);

watch(narrow.value, () => {
if (currentPage.value?.route.name == null && !narrow.value) {
router.push('/admin/overview');
}
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

削除した理由は何かしら

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

マウント時のリダイレクトだけで十分なため(実際、設定ページの方はそうなっている)


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');
}
});

Expand Down
3 changes: 0 additions & 3 deletions packages/frontend/src/pages/settings/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,6 @@ const menuDef = computed(() => [{
}],
}]);

watch(narrow, () => {
});

onMounted(() => {
ro.observe(el.value);

Expand Down
Loading