From ac4089f37d7a5cf2d6da80318345a03da24b6811 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: Fri, 8 Dec 2023 13:06:42 +0900 Subject: [PATCH] =?UTF-8?q?enhance(frontend):=20=E3=82=A6=E3=82=A3?= =?UTF-8?q?=E3=82=B8=E3=82=A7=E3=83=83=E3=83=88=E3=82=92=E9=9D=9E=E8=A1=A8?= =?UTF-8?q?=E7=A4=BA=E3=81=AB=E3=81=A7=E3=81=8D=E3=82=8BPageMeta=E3=82=92?= =?UTF-8?q?=E8=BF=BD=E5=8A=A0=20(#12456)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * (enhance) ウィジェットを非表示にできるPageMetaを追加 * fix lint * rename --------- Co-authored-by: syuilo --- packages/frontend/src/pages/admin/index.vue | 3 ++- packages/frontend/src/pages/settings/index.vue | 1 + packages/frontend/src/scripts/page-metadata.ts | 1 + packages/frontend/src/ui/classic.vue | 12 ++++++------ packages/frontend/src/ui/universal.vue | 14 +++++++------- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/packages/frontend/src/pages/admin/index.vue b/packages/frontend/src/pages/admin/index.vue index 414889125..9fcbb3ae6 100644 --- a/packages/frontend/src/pages/admin/index.vue +++ b/packages/frontend/src/pages/admin/index.vue @@ -261,6 +261,7 @@ provideMetadataReceiver((info) => { childInfo.value = null; } else { childInfo.value = info; + INFO.value.needWideArea = info.value.needWideArea ?? undefined; } }); @@ -268,7 +269,7 @@ function invite() { os.api('admin/invite/create').then(x => { os.alert({ type: 'info', - text: x?.[0].code, + text: x[0].code, }); }).catch(err => { os.alert({ diff --git a/packages/frontend/src/pages/settings/index.vue b/packages/frontend/src/pages/settings/index.vue index 49290e7c2..633ee894a 100644 --- a/packages/frontend/src/pages/settings/index.vue +++ b/packages/frontend/src/pages/settings/index.vue @@ -236,6 +236,7 @@ provideMetadataReceiver((info) => { childInfo.value = null; } else { childInfo.value = info; + INFO.value.needWideArea = info.value?.needWideArea ?? undefined; } }); diff --git a/packages/frontend/src/scripts/page-metadata.ts b/packages/frontend/src/scripts/page-metadata.ts index 330ba8da8..369e46aae 100644 --- a/packages/frontend/src/scripts/page-metadata.ts +++ b/packages/frontend/src/scripts/page-metadata.ts @@ -15,6 +15,7 @@ export type PageMetadata = { icon?: string | null; avatar?: Misskey.entities.User | null; userName?: Misskey.entities.User | null; + needWideArea?: boolean; }; export function definePageMetadata(metadata: PageMetadata | null | Ref | ComputedRef): void { diff --git a/packages/frontend/src/ui/classic.vue b/packages/frontend/src/ui/classic.vue index 1a9f939c8..b5381396c 100644 --- a/packages/frontend/src/ui/classic.vue +++ b/packages/frontend/src/ui/classic.vue @@ -11,7 +11,7 @@ SPDX-License-Identifier: AGPL-3.0-only -
+
@@ -21,7 +21,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+
@@ -64,7 +64,7 @@ const DESKTOP_THRESHOLD = 1100; const isDesktop = ref(window.innerWidth >= DESKTOP_THRESHOLD); -const pageMetadata = ref>(); +const pageMetadata = ref(); const widgetsShowing = ref(false); const fullView = ref(false); const globalHeaderHeight = ref(0); @@ -76,9 +76,9 @@ const widgetsRight = ref(); provide('router', mainRouter); provideMetadataReceiver((info) => { - pageMetadata.value = info; - if (pageMetadata.value.value) { - document.title = `${pageMetadata.value.value.title} | ${instanceName}`; + pageMetadata.value = info.value; + if (pageMetadata.value) { + document.title = `${pageMetadata.value.title} | ${instanceName}`; } }); provide('shouldHeaderThin', showMenuOnTop.value); diff --git a/packages/frontend/src/ui/universal.vue b/packages/frontend/src/ui/universal.vue index 4721507f7..cba7b8261 100644 --- a/packages/frontend/src/ui/universal.vue +++ b/packages/frontend/src/ui/universal.vue @@ -18,11 +18,11 @@ SPDX-License-Identifier: AGPL-3.0-only
-
+
- +
@@ -95,7 +95,7 @@ SPDX-License-Identifier: AGPL-3.0-only