fix(frontend/pageMetadata): ページタイトルが更新されない問題 (#13289)
Co-authored-by: syuilo <Syuilotan@yahoo.co.jp> Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
@@ -106,10 +106,10 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.accounts,
|
||||
icon: 'ti ti-users',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
@@ -45,8 +45,8 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: 'API',
|
||||
icon: 'ti ti-api',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
@@ -75,10 +75,10 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.installedApps,
|
||||
icon: 'ti ti-plug',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
@@ -128,10 +128,10 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.avatarDecorations,
|
||||
icon: 'ti ti-sparkles',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
@@ -45,8 +45,8 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.customCss,
|
||||
icon: 'ti ti-code',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
@@ -36,8 +36,8 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.deck,
|
||||
icon: 'ti ti-columns',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
@@ -117,10 +117,10 @@ function onContextMenu(ev: MouseEvent, file): void {
|
||||
os.contextMenu(getDriveFileMenu(file), ev);
|
||||
}
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.drivecleaner,
|
||||
icon: 'ti ti-trash',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
@@ -143,10 +143,10 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.drive,
|
||||
icon: 'ti ti-cloud',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
@@ -113,8 +113,8 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.email,
|
||||
icon: 'ti ti-mail',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
@@ -237,10 +237,10 @@ watch(pinnedEmojis, () => {
|
||||
deep: true,
|
||||
});
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.emojiPicker,
|
||||
icon: 'ti ti-mood-happy',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
@@ -465,8 +465,8 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.general,
|
||||
icon: 'ti ti-adjustments',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
@@ -225,10 +225,10 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.importAndExport,
|
||||
icon: 'ti ti-package',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
||||
<style module>
|
||||
|
@@ -28,14 +28,14 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { ComputedRef, Ref, computed, onActivated, onMounted, onUnmounted, ref, shallowRef, watch } from 'vue';
|
||||
import { computed, onActivated, onMounted, onUnmounted, ref, shallowRef, watch } from 'vue';
|
||||
import { i18n } from '@/i18n.js';
|
||||
import MkInfo from '@/components/MkInfo.vue';
|
||||
import MkSuperMenu from '@/components/MkSuperMenu.vue';
|
||||
import { signout, $i } from '@/account.js';
|
||||
import { clearCache } from '@/scripts/clear-cache.js';
|
||||
import { instance } from '@/instance.js';
|
||||
import { PageMetadata, definePageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata.js';
|
||||
import { PageMetadata, definePageMetadata, provideMetadataReceiver, provideReactiveMetadata } from '@/scripts/page-metadata.js';
|
||||
import * as os from '@/os.js';
|
||||
import { useRouter } from '@/router/supplier.js';
|
||||
|
||||
@@ -46,7 +46,7 @@ const indexInfo = {
|
||||
};
|
||||
const INFO = ref(indexInfo);
|
||||
const el = shallowRef<HTMLElement | null>(null);
|
||||
const childInfo: Ref<ComputedRef<PageMetadata> | null> = ref(null);
|
||||
const childInfo = ref<null | PageMetadata>(null);
|
||||
|
||||
const router = useRouter();
|
||||
|
||||
@@ -231,20 +231,22 @@ watch(router.currentRef, (to) => {
|
||||
|
||||
const emailNotConfigured = computed(() => instance.enableEmail && ($i.email == null || !$i.emailVerified));
|
||||
|
||||
provideMetadataReceiver((info) => {
|
||||
provideMetadataReceiver((metadataGetter) => {
|
||||
const info = metadataGetter();
|
||||
if (info == null) {
|
||||
childInfo.value = null;
|
||||
} else {
|
||||
childInfo.value = info;
|
||||
INFO.value.needWideArea = info.value.needWideArea ?? undefined;
|
||||
INFO.value.needWideArea = info.needWideArea ?? undefined;
|
||||
}
|
||||
});
|
||||
provideReactiveMetadata(INFO);
|
||||
|
||||
const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata(INFO);
|
||||
definePageMetadata(() => INFO.value);
|
||||
// w 890
|
||||
// h 700
|
||||
</script>
|
||||
|
@@ -121,10 +121,10 @@ async function save(): Promise<void> {
|
||||
|
||||
init();
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.accountMigration,
|
||||
icon: 'ti ti-plane',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
||||
<style lang="scss">
|
||||
|
@@ -230,10 +230,10 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.muteAndBlock,
|
||||
icon: 'ti ti-ban',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
@@ -118,10 +118,10 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.navbar,
|
||||
icon: 'ti ti-list',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
@@ -117,8 +117,8 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.notifications,
|
||||
icon: 'ti ti-bell',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
@@ -162,8 +162,8 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.other,
|
||||
icon: 'ti ti-dots',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
@@ -53,8 +53,8 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts._plugin.install,
|
||||
icon: 'ti ti-download',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
@@ -125,8 +125,8 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.plugins,
|
||||
icon: 'ti ti-plug',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
@@ -37,7 +37,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { computed, onMounted, onUnmounted, ref } from 'vue';
|
||||
import { onMounted, onUnmounted, ref } from 'vue';
|
||||
import { v4 as uuid } from 'uuid';
|
||||
import FormSection from '@/components/form/section.vue';
|
||||
import MkButton from '@/components/MkButton.vue';
|
||||
@@ -437,10 +437,10 @@ onUnmounted(() => {
|
||||
connection?.off('registryUpdated');
|
||||
});
|
||||
|
||||
definePageMetadata(computed(() => ({
|
||||
definePageMetadata(() => ({
|
||||
title: ts.preferencesBackups,
|
||||
icon: 'ti ti-device-floppy',
|
||||
})));
|
||||
}));
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
@@ -118,8 +118,8 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.privacy,
|
||||
icon: 'ti ti-lock-open',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
@@ -260,10 +260,10 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.profile,
|
||||
icon: 'ti ti-user',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
@@ -37,10 +37,10 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.roles,
|
||||
icon: 'ti ti-badges',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
||||
<style lang="scss" module>
|
||||
|
@@ -103,10 +103,10 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.security,
|
||||
icon: 'ti ti-lock',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@@ -94,8 +94,8 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.sounds,
|
||||
icon: 'ti ti-music',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
@@ -50,8 +50,8 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.statusbar,
|
||||
icon: 'ti ti-list',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
@@ -59,8 +59,8 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts._theme.install,
|
||||
icon: 'ti ti-download',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
@@ -76,8 +76,8 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts._theme.manage,
|
||||
icon: 'ti ti-tool',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
@@ -177,10 +177,10 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: i18n.ts.theme,
|
||||
icon: 'ti ti-palette',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
@@ -114,8 +114,8 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: 'Edit webhook',
|
||||
icon: 'ti ti-webhook',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
@@ -82,8 +82,8 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: 'Create new webhook',
|
||||
icon: 'ti ti-webhook',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
@@ -50,8 +50,8 @@ const headerActions = computed(() => []);
|
||||
|
||||
const headerTabs = computed(() => []);
|
||||
|
||||
definePageMetadata({
|
||||
definePageMetadata(() => ({
|
||||
title: 'Webhook',
|
||||
icon: 'ti ti-webhook',
|
||||
});
|
||||
}));
|
||||
</script>
|
||||
|
Reference in New Issue
Block a user