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:
taiy 2024-02-16 16:17:09 +09:00 committed by GitHub
parent bb83ee844e
commit 860e8bb5d8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
140 changed files with 496 additions and 430 deletions

View file

@ -16,9 +16,9 @@ SPDX-License-Identifier: AGPL-3.0-only
@closed="$emit('closed')" @closed="$emit('closed')"
> >
<template #header> <template #header>
<template v-if="pageMetadata?.value"> <template v-if="pageMetadata">
<i v-if="pageMetadata.value.icon" :class="pageMetadata.value.icon" style="margin-right: 0.5em;"></i> <i v-if="pageMetadata.icon" :class="pageMetadata.icon" style="margin-right: 0.5em;"></i>
<span>{{ pageMetadata.value.title }}</span> <span>{{ pageMetadata.title }}</span>
</template> </template>
</template> </template>
@ -29,7 +29,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ComputedRef, onMounted, onUnmounted, provide, ref, shallowRef } from 'vue'; import { computed, onMounted, onUnmounted, provide, ref, shallowRef } from 'vue';
import RouterView from '@/components/global/RouterView.vue'; import RouterView from '@/components/global/RouterView.vue';
import MkWindow from '@/components/MkWindow.vue'; import MkWindow from '@/components/MkWindow.vue';
import { popout as _popout } from '@/scripts/popout.js'; import { popout as _popout } from '@/scripts/popout.js';
@ -37,7 +37,7 @@ import copyToClipboard from '@/scripts/copy-to-clipboard.js';
import { url } from '@/config.js'; import { url } from '@/config.js';
import { useScrollPositionManager } from '@/nirax.js'; import { useScrollPositionManager } from '@/nirax.js';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import { PageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata.js'; import { PageMetadata, provideMetadataReceiver, provideReactiveMetadata } from '@/scripts/page-metadata.js';
import { openingWindowsCount } from '@/os.js'; import { openingWindowsCount } from '@/os.js';
import { claimAchievement } from '@/scripts/achievements.js'; import { claimAchievement } from '@/scripts/achievements.js';
import { getScrollContainer } from '@/scripts/scroll.js'; import { getScrollContainer } from '@/scripts/scroll.js';
@ -56,7 +56,7 @@ const routerFactory = useRouterFactory();
const windowRouter = routerFactory(props.initialPath); const windowRouter = routerFactory(props.initialPath);
const contents = shallowRef<HTMLElement | null>(null); const contents = shallowRef<HTMLElement | null>(null);
const pageMetadata = ref<null | ComputedRef<PageMetadata>>(); const pageMetadata = ref<null | PageMetadata>(null);
const windowEl = shallowRef<InstanceType<typeof MkWindow>>(); const windowEl = shallowRef<InstanceType<typeof MkWindow>>();
const history = ref<{ path: string; key: any; }[]>([{ const history = ref<{ path: string; key: any; }[]>([{
path: windowRouter.getCurrentPath(), path: windowRouter.getCurrentPath(),
@ -101,9 +101,11 @@ windowRouter.addListener('replace', ctx => {
windowRouter.init(); windowRouter.init();
provide('router', windowRouter); provide('router', windowRouter);
provideMetadataReceiver((info) => { provideMetadataReceiver((metadataGetter) => {
const info = metadataGetter();
pageMetadata.value = info; pageMetadata.value = info;
}); });
provideReactiveMetadata(pageMetadata);
provide('shouldOmitHeaderTitle', true); provide('shouldOmitHeaderTitle', true);
provide('shouldHeaderThin', true); provide('shouldHeaderThin', true);
provide('forceSpacerMin', true); provide('forceSpacerMin', true);

View file

@ -11,18 +11,18 @@ SPDX-License-Identifier: AGPL-3.0-only
</div> </div>
<div v-else-if="!thin_ && narrow && !hideTitle" :class="$style.buttonsLeft"/> <div v-else-if="!thin_ && narrow && !hideTitle" :class="$style.buttonsLeft"/>
<template v-if="metadata"> <template v-if="pageMetadata">
<div v-if="!hideTitle" :class="$style.titleContainer" @click="top"> <div v-if="!hideTitle" :class="$style.titleContainer" @click="top">
<div v-if="metadata.avatar" :class="$style.titleAvatarContainer"> <div v-if="pageMetadata.avatar" :class="$style.titleAvatarContainer">
<MkAvatar :class="$style.titleAvatar" :user="metadata.avatar" indicator/> <MkAvatar :class="$style.titleAvatar" :user="pageMetadata.avatar" indicator/>
</div> </div>
<i v-else-if="metadata.icon" :class="[$style.titleIcon, metadata.icon]"></i> <i v-else-if="pageMetadata.icon" :class="[$style.titleIcon, pageMetadata.icon]"></i>
<div :class="$style.title"> <div :class="$style.title">
<MkUserName v-if="metadata.userName" :user="metadata.userName" :nowrap="true"/> <MkUserName v-if="pageMetadata.userName" :user="pageMetadata.userName" :nowrap="true"/>
<div v-else-if="metadata.title">{{ metadata.title }}</div> <div v-else-if="pageMetadata.title">{{ pageMetadata.title }}</div>
<div v-if="metadata.subtitle" :class="$style.subtitle"> <div v-if="pageMetadata.subtitle" :class="$style.subtitle">
{{ metadata.subtitle }} {{ pageMetadata.subtitle }}
</div> </div>
</div> </div>
</div> </div>
@ -46,7 +46,7 @@ import tinycolor from 'tinycolor2';
import XTabs, { Tab } from './MkPageHeader.tabs.vue'; import XTabs, { Tab } from './MkPageHeader.tabs.vue';
import { scrollToTop } from '@/scripts/scroll.js'; import { scrollToTop } from '@/scripts/scroll.js';
import { globalEvents } from '@/events.js'; import { globalEvents } from '@/events.js';
import { injectPageMetadata } from '@/scripts/page-metadata.js'; import { injectReactiveMetadata } from '@/scripts/page-metadata.js';
import { $i, openAccountMenu as openAccountMenu_ } from '@/account.js'; import { $i, openAccountMenu as openAccountMenu_ } from '@/account.js';
import { PageHeaderItem } from '@/types/page-header.js'; import { PageHeaderItem } from '@/types/page-header.js';
@ -64,7 +64,7 @@ const emit = defineEmits<{
(ev: 'update:tab', key: string); (ev: 'update:tab', key: string);
}>(); }>();
const metadata = injectPageMetadata(); const pageMetadata = injectReactiveMetadata();
const hideTitle = inject('shouldOmitHeaderTitle', false); const hideTitle = inject('shouldOmitHeaderTitle', false);
const thin_ = props.thin || inject('shouldHeaderThin', false); const thin_ = props.thin || inject('shouldHeaderThin', false);

View file

@ -18,7 +18,7 @@ export const langs = _LANGS_;
const preParseLocale = miLocalStorage.getItem('locale'); const preParseLocale = miLocalStorage.getItem('locale');
export let locale = preParseLocale ? JSON.parse(preParseLocale) : null; export let locale = preParseLocale ? JSON.parse(preParseLocale) : null;
export const version = _VERSION_; export const version = _VERSION_;
export const instanceName = siteName === 'Misskey' ? host : siteName; export const instanceName = siteName === 'Misskey' || siteName == null ? host : siteName;
export const ui = miLocalStorage.getItem('ui'); export const ui = miLocalStorage.getItem('ui');
export const debug = miLocalStorage.getItem('debug') === 'true'; export const debug = miLocalStorage.getItem('debug') === 'true';

View file

@ -67,10 +67,10 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.error, title: i18n.ts.error,
icon: 'ti ti-alert-triangle', icon: 'ti ti-alert-triangle',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -363,10 +363,10 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.aboutMisskey, title: i18n.ts.aboutMisskey,
icon: null, icon: null,
}); }));
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View file

@ -164,10 +164,10 @@ const headerTabs = computed(() => [{
icon: 'ti ti-chart-line', icon: 'ti ti-chart-line',
}]); }]);
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: i18n.ts.instanceInfo, title: i18n.ts.instanceInfo,
icon: 'ti ti-info-circle', icon: 'ti ti-info-circle',
}))); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -48,10 +48,10 @@ onDeactivated(() => {
} }
}); });
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.achievements, title: i18n.ts.achievements,
icon: 'ti ti-medal', icon: 'ti ti-medal',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -140,10 +140,10 @@ const headerTabs = computed(() => [{
icon: 'ti ti-code', icon: 'ti ti-code',
}]); }]);
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: file.value ? i18n.ts.file + ': ' + file.value.name : i18n.ts.file, title: file.value ? `${i18n.ts.file}: ${file.value.name}` : i18n.ts.file,
icon: 'ti ti-file', icon: 'ti ti-file',
}))); }));
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View file

@ -518,10 +518,10 @@ const headerTabs = computed(() => [{
icon: 'ti ti-code', icon: 'ti ti-code',
}]); }]);
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: user.value ? acct(user.value) : i18n.ts.userInfo, title: user.value ? acct(user.value) : i18n.ts.userInfo,
icon: 'ti ti-user-exclamation', icon: 'ti ti-user-exclamation',
}))); }));
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View file

@ -5,12 +5,12 @@ SPDX-License-Identifier: AGPL-3.0-only
<template> <template>
<div ref="el" class="fdidabkc" :style="{ background: bg }" @click="onClick"> <div ref="el" class="fdidabkc" :style="{ background: bg }" @click="onClick">
<template v-if="metadata"> <template v-if="pageMetadata">
<div class="titleContainer" @click="showTabsPopup"> <div class="titleContainer" @click="showTabsPopup">
<i v-if="metadata.icon" class="icon" :class="metadata.icon"></i> <i v-if="pageMetadata.icon" class="icon" :class="pageMetadata.icon"></i>
<div class="title"> <div class="title">
<div class="title">{{ metadata.title }}</div> <div class="title">{{ pageMetadata.title }}</div>
</div> </div>
</div> </div>
<div class="tabs"> <div class="tabs">
@ -39,7 +39,7 @@ import { popupMenu } from '@/os.js';
import { scrollToTop } from '@/scripts/scroll.js'; import { scrollToTop } from '@/scripts/scroll.js';
import MkButton from '@/components/MkButton.vue'; import MkButton from '@/components/MkButton.vue';
import { globalEvents } from '@/events.js'; import { globalEvents } from '@/events.js';
import { injectPageMetadata } from '@/scripts/page-metadata.js'; import { injectReactiveMetadata } from '@/scripts/page-metadata.js';
type Tab = { type Tab = {
key?: string | null; key?: string | null;
@ -65,7 +65,7 @@ const emit = defineEmits<{
(ev: 'update:tab', key: string); (ev: 'update:tab', key: string);
}>(); }>();
const metadata = injectPageMetadata(); const pageMetadata = injectReactiveMetadata();
const el = shallowRef<HTMLElement>(null); const el = shallowRef<HTMLElement>(null);
const tabRefs = {}; const tabRefs = {};
@ -118,7 +118,7 @@ function onTabClick(tab: Tab, ev: MouseEvent): void {
} }
const calcBg = () => { const calcBg = () => {
const rawBg = metadata?.bg ?? 'var(--bg)'; const rawBg = pageMetadata.value?.bg ?? 'var(--bg)';
const tinyBg = tinycolor(rawBg.startsWith('var(') ? getComputedStyle(document.documentElement).getPropertyValue(rawBg.slice(4, -1)) : rawBg); const tinyBg = tinycolor(rawBg.startsWith('var(') ? getComputedStyle(document.documentElement).getPropertyValue(rawBg.slice(4, -1)) : rawBg);
tinyBg.setAlpha(0.85); tinyBg.setAlpha(0.85);
bg.value = tinyBg.toRgbString(); bg.value = tinyBg.toRgbString();

View file

@ -87,8 +87,8 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.abuseReports, title: i18n.ts.abuseReports,
icon: 'ti ti-exclamation-circle', icon: 'ti ti-exclamation-circle',
}); }));
</script> </script>

View file

@ -255,10 +255,10 @@ const headerActions = computed(() => [{
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.ads, title: i18n.ts.ads,
icon: 'ti ti-ad', icon: 'ti ti-ad',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -157,8 +157,8 @@ const headerActions = computed(() => [{
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.announcements, title: i18n.ts.announcements,
icon: 'ti ti-speakerphone', icon: 'ti ti-speakerphone',
}); }));
</script> </script>

View file

@ -159,10 +159,10 @@ function save() {
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.branding, title: i18n.ts.branding,
icon: 'ti ti-paint', icon: 'ti ti-paint',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -33,8 +33,8 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.database, title: i18n.ts.database,
icon: 'ti ti-database', icon: 'ti ti-database',
}); }));
</script> </script>

View file

@ -130,10 +130,10 @@ function save() {
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.emailServer, title: i18n.ts.emailServer,
icon: 'ti ti-mail', icon: 'ti ti-mail',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -69,10 +69,10 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.externalServices, title: i18n.ts.externalServices,
icon: 'ti ti-link', icon: 'ti ti-link',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -102,10 +102,10 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: i18n.ts.federation, title: i18n.ts.federation,
icon: 'ti ti-whirl', icon: 'ti ti-whirl',
}))); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -108,8 +108,8 @@ const headerActions = computed(() => [{
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: i18n.ts.files, title: i18n.ts.files,
icon: 'ti ti-cloud', icon: 'ti ti-cloud',
}))); }));
</script> </script>

View file

@ -28,7 +28,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { ComputedRef, Ref, onActivated, onMounted, onUnmounted, provide, watch, ref, computed } from 'vue'; import { onActivated, onMounted, onUnmounted, provide, watch, ref, computed } from 'vue';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import MkSuperMenu from '@/components/MkSuperMenu.vue'; import MkSuperMenu from '@/components/MkSuperMenu.vue';
import MkInfo from '@/components/MkInfo.vue'; import MkInfo from '@/components/MkInfo.vue';
@ -36,7 +36,7 @@ import { instance } from '@/instance.js';
import * as os from '@/os.js'; import * as os from '@/os.js';
import { misskeyApi } from '@/scripts/misskey-api.js'; import { misskeyApi } from '@/scripts/misskey-api.js';
import { lookupUser, lookupUserByEmail } from '@/scripts/lookup-user.js'; import { lookupUser, lookupUserByEmail } from '@/scripts/lookup-user.js';
import { PageMetadata, definePageMetadata, provideMetadataReceiver } from '@/scripts/page-metadata.js'; import { PageMetadata, definePageMetadata, provideMetadataReceiver, provideReactiveMetadata } from '@/scripts/page-metadata.js';
import { useRouter } from '@/router/supplier.js'; import { useRouter } from '@/router/supplier.js';
const isEmpty = (x: string | null) => x == null || x === ''; const isEmpty = (x: string | null) => x == null || x === '';
@ -52,7 +52,7 @@ const indexInfo = {
provide('shouldOmitHeaderTitle', false); provide('shouldOmitHeaderTitle', false);
const INFO = ref(indexInfo); const INFO = ref(indexInfo);
const childInfo: Ref<ComputedRef<PageMetadata> | null> = ref(null); const childInfo = ref<null | PageMetadata>(null);
const narrow = ref(false); const narrow = ref(false);
const view = ref(null); const view = ref(null);
const el = ref<HTMLDivElement | null>(null); const el = ref<HTMLDivElement | null>(null);
@ -257,14 +257,16 @@ watch(router.currentRef, (to) => {
} }
}); });
provideMetadataReceiver((info) => { provideMetadataReceiver((metadataGetter) => {
const info = metadataGetter();
if (info == null) { if (info == null) {
childInfo.value = null; childInfo.value = null;
} else { } else {
childInfo.value = info; childInfo.value = info;
INFO.value.needWideArea = info.value.needWideArea ?? undefined; INFO.value.needWideArea = info.needWideArea ?? undefined;
} }
}); });
provideReactiveMetadata(INFO);
function invite() { function invite() {
misskeyApi('admin/invite/create').then(x => { misskeyApi('admin/invite/create').then(x => {
@ -318,7 +320,7 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata(INFO.value); definePageMetadata(() => INFO.value);
defineExpose({ defineExpose({
header: { header: {

View file

@ -66,8 +66,8 @@ const headerTabs = computed(() => [{
icon: 'ti ti-eye-off', icon: 'ti ti-eye-off',
}]); }]);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.instanceBlocking, title: i18n.ts.instanceBlocking,
icon: 'ti ti-ban', icon: 'ti ti-ban',
}); }));
</script> </script>

View file

@ -113,10 +113,10 @@ function deleted(id: string) {
const headerActions = computed(() => []); const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.invite, title: i18n.ts.invite,
icon: 'ti ti-user-plus', icon: 'ti ti-user-plus',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -116,10 +116,10 @@ function save() {
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.moderation, title: i18n.ts.moderation,
icon: 'ti ti-shield', icon: 'ti ti-shield',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -60,8 +60,8 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.moderationLogs, title: i18n.ts.moderationLogs,
icon: 'ti ti-list-search', icon: 'ti ti-list-search',
}); }));
</script> </script>

View file

@ -149,10 +149,10 @@ function save() {
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.objectStorage, title: i18n.ts.objectStorage,
icon: 'ti ti-cloud', icon: 'ti ti-cloud',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -86,8 +86,8 @@ const headerActions = computed(() => [{
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.other, title: i18n.ts.other,
icon: 'ti ti-adjustments', icon: 'ti ti-adjustments',
}); }));
</script> </script>

View file

@ -184,10 +184,10 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.dashboard, title: i18n.ts.dashboard,
icon: 'ti ti-dashboard', icon: 'ti ti-dashboard',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -64,8 +64,8 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.proxyAccount, title: i18n.ts.proxyAccount,
icon: 'ti ti-ghost', icon: 'ti ti-ghost',
}); }));
</script> </script>

View file

@ -68,8 +68,8 @@ const headerTabs = computed(() => [{
title: 'Inbox', title: 'Inbox',
}]); }]);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.jobQueue, title: i18n.ts.jobQueue,
icon: 'ti ti-clock-play', icon: 'ti ti-clock-play',
}); }));
</script> </script>

View file

@ -84,10 +84,10 @@ const headerActions = computed(() => [{
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.relays, title: i18n.ts.relays,
icon: 'ti ti-planet', icon: 'ti ti-planet',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -87,11 +87,8 @@ async function save() {
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata(computed(() => role.value ? { definePageMetadata(() => ({
title: i18n.ts._role.edit + ': ' + role.value.name, title: role.value ? `${i18n.ts._role.edit}: ${role.value.name}` : i18n.ts._role.new,
icon: 'ti ti-badge',
} : {
title: i18n.ts._role.new,
icon: 'ti ti-badge', icon: 'ti ti-badge',
})); }));
</script> </script>

View file

@ -170,10 +170,10 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: i18n.ts.role + ': ' + role.name, title: `${i18n.ts.role}: ${role.name}`,
icon: 'ti ti-badge', icon: 'ti ti-badge',
}))); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -270,10 +270,10 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: i18n.ts.roles, title: i18n.ts.roles,
icon: 'ti ti-badges', icon: 'ti ti-badges',
}))); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -229,8 +229,8 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.security, title: i18n.ts.security,
icon: 'ti ti-lock', icon: 'ti ti-lock',
}); }));
</script> </script>

View file

@ -67,10 +67,10 @@ const remove = (index: number): void => {
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.serverRules, title: i18n.ts.serverRules,
icon: 'ti ti-checkbox', icon: 'ti ti-checkbox',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -235,10 +235,10 @@ async function save(): void {
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.general, title: i18n.ts.general,
icon: 'ti ti-settings', icon: 'ti ti-settings',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -137,10 +137,10 @@ const headerActions = computed(() => [{
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: i18n.ts.users, title: i18n.ts.users,
icon: 'ti ti-users', icon: 'ti ti-users',
}))); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -20,9 +20,9 @@ import { definePageMetadata } from '@/scripts/page-metadata.js';
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import { instance } from '@/instance.js'; import { instance } from '@/instance.js';
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.ads, title: i18n.ts.ads,
icon: 'ti ti-ad', icon: 'ti ti-ad',
}); }));
</script> </script>

View file

@ -106,10 +106,10 @@ const headerTabs = computed(() => [{
icon: 'ti ti-point', icon: 'ti ti-point',
}]); }]);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.announcements, title: i18n.ts.announcements,
icon: 'ti ti-speakerphone', icon: 'ti ti-speakerphone',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -91,10 +91,10 @@ const headerActions = computed(() => antenna.value ? [{
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata(computed(() => antenna.value ? { definePageMetadata(() => ({
title: antenna.value.name, title: antenna.value ? antenna.value.name : i18n.ts.antennas,
icon: 'ti ti-antenna', icon: 'ti ti-antenna',
} : null)); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -87,8 +87,8 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: 'API console', title: 'API console',
icon: 'ti ti-terminal-2', icon: 'ti ti-terminal-2',
}); }));
</script> </script>

View file

@ -97,10 +97,10 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts._auth.shareAccessTitle, title: i18n.ts._auth.shareAccessTitle,
icon: 'ti ti-apps', icon: 'ti ti-apps',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -94,8 +94,8 @@ const headerActions = computed(() => [{
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.avatarDecorations, title: i18n.ts.avatarDecorations,
icon: 'ti ti-sparkles', icon: 'ti ti-sparkles',
}); }));
</script> </script>

View file

@ -202,11 +202,8 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata(computed(() => props.channelId ? { definePageMetadata(() => ({
title: i18n.ts._channel.edit, title: props.channelId ? i18n.ts._channel.edit : i18n.ts._channel.create,
icon: 'ti ti-device-tv',
} : {
title: i18n.ts._channel.create,
icon: 'ti ti-device-tv', icon: 'ti ti-device-tv',
})); }));
</script> </script>

View file

@ -258,10 +258,10 @@ const headerTabs = computed(() => [{
icon: 'ti ti-search', icon: 'ti ti-search',
}]); }]);
definePageMetadata(computed(() => channel.value ? { definePageMetadata(() => ({
title: channel.value.name, title: channel.value ? channel.value.name : i18n.ts.channel,
icon: 'ti ti-device-tv', icon: 'ti ti-device-tv',
} : null)); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -152,8 +152,8 @@ const headerTabs = computed(() => [{
icon: 'ti ti-edit', icon: 'ti ti-edit',
}]); }]);
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: i18n.ts.channel, title: i18n.ts.channel,
icon: 'ti ti-device-tv', icon: 'ti ti-device-tv',
}))); }));
</script> </script>

View file

@ -16,10 +16,10 @@ SPDX-License-Identifier: AGPL-3.0-only
import MkClickerGame from '@/components/MkClickerGame.vue'; import MkClickerGame from '@/components/MkClickerGame.vue';
import { definePageMetadata } from '@/scripts/page-metadata.js'; import { definePageMetadata } from '@/scripts/page-metadata.js';
definePageMetadata({ definePageMetadata(() => ({
title: '🍪👈', title: '🍪👈',
icon: 'ti ti-cookie', icon: 'ti ti-cookie',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -157,10 +157,10 @@ const headerActions = computed(() => clip.value && isOwned.value ? [{
}, },
}] : null); }] : null);
definePageMetadata(computed(() => clip.value ? { definePageMetadata(() => ({
title: clip.value.name, title: clip.value ? clip.value.name : i18n.ts.clip,
icon: 'ti ti-paperclip', icon: 'ti ti-paperclip',
} : null)); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -305,10 +305,10 @@ const headerTabs = computed(() => [{
title: i18n.ts.remote, title: i18n.ts.remote,
}]); }]);
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: i18n.ts.customEmojis, title: i18n.ts.customEmojis,
icon: 'ti ti-icons', icon: 'ti ti-icons',
}))); }));
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View file

@ -48,8 +48,8 @@ const headerTabs = computed(() => [{
icon: 'ti ti-pencil', icon: 'ti ti-pencil',
}]); }]);
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: i18n.ts._fileViewer.title, title: i18n.ts._fileViewer.title,
icon: 'ti ti-file', icon: 'ti ti-file',
}))); }));
</script> </script>

View file

@ -22,9 +22,9 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: folder.value ? folder.value.name : i18n.ts.drive, title: folder.value ? folder.value.name : i18n.ts.drive,
icon: 'ti ti-cloud', icon: 'ti ti-cloud',
hideHeader: true, hideHeader: true,
}))); }));
</script> </script>

View file

@ -1204,10 +1204,10 @@ onDeactivated(() => {
bgmNodes?.soundSource.stop(); bgmNodes?.soundSource.stop();
}); });
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.bubbleGame, title: i18n.ts.bubbleGame,
icon: 'ti ti-apple', icon: 'ti ti-apple',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -121,10 +121,10 @@ function onGameEnd() {
gameStarted.value = false; gameStarted.value = false;
} }
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.bubbleGame, title: i18n.ts.bubbleGame,
icon: 'ti ti-device-gamepad', icon: 'ti ti-device-gamepad',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -60,8 +60,8 @@ const headerTabs = computed(() => [{
title: i18n.ts.roles, title: i18n.ts.roles,
}]); }]);
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: i18n.ts.explore, title: i18n.ts.explore,
icon: 'ti ti-hash', icon: 'ti ti-hash',
}))); }));
</script> </script>

View file

@ -38,10 +38,10 @@ const pagination = {
limit: 10, limit: 10,
}; };
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.favorites, title: i18n.ts.favorites,
icon: 'ti ti-star', icon: 'ti ti-star',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -452,9 +452,7 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata(computed(() => flash.value ? { definePageMetadata(() => ({
title: i18n.ts._play.edit + ': ' + flash.value.title, title: flash.value ? `${i18n.ts._play.edit}: ${flash.value.title}` : i18n.ts._play.new,
} : {
title: i18n.ts._play.new,
})); }));
</script> </script>

View file

@ -90,8 +90,8 @@ const headerTabs = computed(() => [{
icon: 'ti ti-heart', icon: 'ti ti-heart',
}]); }]);
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: 'Play', title: 'Play',
icon: 'ti ti-player-play', icon: 'ti ti-player-play',
}))); }));
</script> </script>

View file

@ -205,15 +205,17 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata(computed(() => flash.value ? { definePageMetadata(() => ({
title: flash.value.title, title: flash.value ? flash.value.title : 'Play',
avatar: flash.value.user, ...flash.value ? {
path: `/play/${flash.value.id}`, avatar: flash.value.user,
share: { path: `/play/${flash.value.id}`,
title: flash.value.title, share: {
text: flash.value.summary, title: flash.value.title,
}, text: flash.value.summary,
} : null)); },
} : {},
}));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -69,10 +69,10 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: i18n.ts.followRequests, title: i18n.ts.followRequests,
icon: 'ti ti-user-plus', icon: 'ti ti-user-plus',
}))); }));
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View file

@ -122,11 +122,8 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata(computed(() => props.postId ? { definePageMetadata(() => ({
title: i18n.ts.edit, title: props.postId ? i18n.ts.edit : i18n.ts.postToGallery,
icon: 'ti ti-pencil',
} : {
title: i18n.ts.postToGallery,
icon: 'ti ti-pencil', icon: 'ti ti-pencil',
})); }));
</script> </script>

View file

@ -119,10 +119,10 @@ const headerTabs = computed(() => [{
icon: 'ti ti-edit', icon: 'ti ti-edit',
}]); }]);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.gallery, title: i18n.ts.gallery,
icon: 'ti ti-icons', icon: 'ti ti-icons',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -163,10 +163,12 @@ const headerActions = computed(() => [{
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata(computed(() => post.value ? { definePageMetadata(() => ({
title: post.value.title, title: post.value ? post.value.title : i18n.ts.gallery,
avatar: post.value.user, ...post.value ? {
} : null)); avatar: post.value.user,
} : {},
}));
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View file

@ -27,8 +27,8 @@ SPDX-License-Identifier: AGPL-3.0-only
import { i18n } from '@/i18n.js'; import { i18n } from '@/i18n.js';
import { definePageMetadata } from '@/scripts/page-metadata.js'; import { definePageMetadata } from '@/scripts/page-metadata.js';
definePageMetadata({ definePageMetadata(() => ({
title: 'Misskey Games', title: 'Misskey Games',
icon: 'ti ti-device-gamepad', icon: 'ti ti-device-gamepad',
}); }));
</script> </script>

View file

@ -312,10 +312,10 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts._externalResourceInstaller.title, title: i18n.ts._externalResourceInstaller.title,
icon: 'ti ti-download', icon: 'ti ti-download',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -245,10 +245,10 @@ const headerTabs = computed(() => [{
icon: 'ti ti-code', icon: 'ti ti-code',
}]); }]);
definePageMetadata({ definePageMetadata(() => ({
title: props.host, title: props.host,
icon: 'ti ti-server', icon: 'ti ti-server',
}); }));
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View file

@ -93,10 +93,10 @@ async function update() {
update(); update();
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.invite, title: i18n.ts.invite,
icon: 'ti ti-user-plus', icon: 'ti ti-user-plus',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -101,10 +101,10 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata(computed(() => list.value ? { definePageMetadata(() => ({
title: list.value.name, title: list.value ? list.value.name : i18n.ts.lists,
icon: 'ti ti-list', icon: 'ti ti-list',
} : null)); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>
.main { .main {

View file

@ -93,10 +93,10 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: 'MiAuth', title: 'MiAuth',
icon: 'ti ti-apps', icon: 'ti ti-apps',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -38,8 +38,8 @@ function onAntennaCreated() {
router.push('/my/antennas'); router.push('/my/antennas');
} }
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.manageAntennas, title: i18n.ts.manageAntennas,
icon: 'ti ti-antenna', icon: 'ti ti-antenna',
}); }));
</script> </script>

View file

@ -36,8 +36,8 @@ misskeyApi('antennas/show', { antennaId: props.antennaId }).then((antennaRespons
antenna.value = antennaResponse; antenna.value = antennaResponse;
}); });
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.manageAntennas, title: i18n.ts.manageAntennas,
icon: 'ti ti-antenna', icon: 'ti ti-antenna',
}); }));
</script> </script>

View file

@ -55,10 +55,10 @@ const headerActions = computed(() => [{
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.manageAntennas, title: i18n.ts.manageAntennas,
icon: 'ti ti-antenna', icon: 'ti ti-antenna',
}); }));
onActivated(() => { onActivated(() => {
antennasCache.fetch(); antennasCache.fetch();

View file

@ -104,14 +104,10 @@ const headerTabs = computed(() => [{
icon: 'ti ti-heart', icon: 'ti ti-heart',
}]); }]);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.clip, title: i18n.ts.clip,
icon: 'ti ti-paperclip', icon: 'ti ti-paperclip',
action: { }));
icon: 'ti ti-plus',
handler: create,
},
});
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -71,10 +71,10 @@ const headerActions = computed(() => [{
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.manageLists, title: i18n.ts.manageLists,
icon: 'ti ti-list', icon: 'ti ti-list',
}); }));
onActivated(() => { onActivated(() => {
fetch(); fetch();

View file

@ -186,10 +186,10 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata(computed(() => list.value ? { definePageMetadata(() => ({
title: list.value.name, title: list.value ? list.value.name : i18n.ts.lists,
icon: 'ti ti-list', icon: 'ti ti-list',
} : null)); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -31,8 +31,8 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.notFound, title: i18n.ts.notFound,
icon: 'ti ti-alert-triangle', icon: 'ti ti-alert-triangle',
}); }));
</script> </script>

View file

@ -141,16 +141,18 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata(computed(() => note.value ? { definePageMetadata(() => ({
title: i18n.ts.note, title: i18n.ts.note,
subtitle: dateString(note.value.createdAt), ...note.value ? {
avatar: note.value.user, subtitle: dateString(note.value.createdAt),
path: `/notes/${note.value.id}`, avatar: note.value.user,
share: { path: `/notes/${note.value.id}`,
title: i18n.tsx.noteOf({ user: note.value.user.name }), share: {
text: note.value.text, title: i18n.tsx.noteOf({ user: note.value.user.name }),
}, text: note.value.text,
} : null)); },
} : {},
}));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -94,10 +94,10 @@ const headerTabs = computed(() => [{
icon: 'ti ti-mail', icon: 'ti ti-mail',
}]); }]);
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: i18n.ts.notifications, title: i18n.ts.notifications,
icon: 'ti ti-bell', icon: 'ti ti-bell',
}))); }));
</script> </script>
<style module lang="scss"> <style module lang="scss">

View file

@ -51,10 +51,10 @@ function onLogin(res): void {
login(res.i); login(res.i);
} }
definePageMetadata({ definePageMetadata(() => ({
title: 'OAuth', title: 'OAuth',
icon: 'ti ti-apps', icon: 'ti ti-apps',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -284,17 +284,11 @@ const headerTabs = computed(() => [{
icon: 'ti ti-note', icon: 'ti ti-note',
}]); }]);
definePageMetadata(computed(() => { definePageMetadata(() => ({
let title = i18n.ts._pages.newPage; title: props.initPageId ? i18n.ts._pages.editPage
if (props.initPageId) { : props.initPageName && props.initUser ? i18n.ts._pages.readPage
title = i18n.ts._pages.editPage; : i18n.ts._pages.newPage,
} else if (props.initPageName && props.initUser) { icon: 'ti ti-pencil',
title = i18n.ts._pages.readPage;
}
return {
title: title,
icon: 'ti ti-pencil',
};
})); }));
</script> </script>

View file

@ -187,15 +187,17 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata(computed(() => page.value ? { definePageMetadata(() => ({
title: page.value.title || page.value.name, title: page.value ? page.value.title || page.value.name : i18n.ts.pages,
avatar: page.value.user, ...page.value ? {
path: `/@${page.value.user.username}/pages/${page.value.name}`, avatar: page.value.user,
share: { path: `/@${page.value.user.username}/pages/${page.value.name}`,
title: page.value.title || page.value.name, share: {
text: page.value.summary, title: page.value.title || page.value.name,
}, text: page.value.summary,
} : null)); },
} : {},
}));
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>

View file

@ -88,8 +88,8 @@ const headerTabs = computed(() => [{
icon: 'ti ti-heart', icon: 'ti ti-heart',
}]); }]);
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: i18n.ts.pages, title: i18n.ts.pages,
icon: 'ti ti-note', icon: 'ti ti-note',
}))); }));
</script> </script>

View file

@ -96,8 +96,8 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.registry, title: i18n.ts.registry,
icon: 'ti ti-adjustments', icon: 'ti ti-adjustments',
}); }));
</script> </script>

View file

@ -123,8 +123,8 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.registry, title: i18n.ts.registry,
icon: 'ti ti-adjustments', icon: 'ti ti-adjustments',
}); }));
</script> </script>

View file

@ -73,8 +73,8 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.registry, title: i18n.ts.registry,
icon: 'ti ti-adjustments', icon: 'ti ti-adjustments',
}); }));
</script> </script>

View file

@ -53,8 +53,8 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.resetPassword, title: i18n.ts.resetPassword,
icon: 'ti ti-lock', icon: 'ti ti-lock',
}); }));
</script> </script>

View file

@ -113,8 +113,8 @@ onUnmounted(() => {
} }
}); });
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: 'Reversi', title: 'Reversi',
icon: 'ti ti-device-gamepad', icon: 'ti ti-device-gamepad',
}))); }));
</script> </script>

View file

@ -105,7 +105,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onDeactivated, onMounted, onUnmounted, ref } from 'vue'; import { onDeactivated, onMounted, onUnmounted, ref } from 'vue';
import * as Misskey from 'misskey-js'; import * as Misskey from 'misskey-js';
import { misskeyApi } from '@/scripts/misskey-api.js'; import { misskeyApi } from '@/scripts/misskey-api.js';
import { definePageMetadata } from '@/scripts/page-metadata.js'; import { definePageMetadata } from '@/scripts/page-metadata.js';
@ -261,10 +261,10 @@ onUnmounted(() => {
cancelMatching(); cancelMatching();
}); });
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: 'Reversi', title: 'Reversi',
icon: 'ti ti-device-gamepad', icon: 'ti ti-device-gamepad',
}))); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -93,10 +93,10 @@ const headerTabs = computed(() => [{
title: i18n.ts.timeline, title: i18n.ts.timeline,
}]); }]);
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: role.value?.name, title: role.value ? role.value.name : i18n.ts.role,
icon: 'ti ti-badge', icon: 'ti ti-badge',
}))); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -152,10 +152,10 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.scratchpad, title: i18n.ts.scratchpad,
icon: 'ti ti-terminal-2', icon: 'ti ti-terminal-2',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -52,8 +52,8 @@ const headerTabs = computed(() => [{
icon: 'ti ti-users', icon: 'ti ti-users',
}]); }]);
definePageMetadata(computed(() => ({ definePageMetadata(() => ({
title: i18n.ts.search, title: i18n.ts.search,
icon: 'ti ti-search', icon: 'ti ti-search',
}))); }));
</script> </script>

View file

@ -106,10 +106,10 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.accounts, title: i18n.ts.accounts,
icon: 'ti ti-users', icon: 'ti ti-users',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -45,8 +45,8 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: 'API', title: 'API',
icon: 'ti ti-api', icon: 'ti ti-api',
}); }));
</script> </script>

View file

@ -75,10 +75,10 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.installedApps, title: i18n.ts.installedApps,
icon: 'ti ti-plug', icon: 'ti ti-plug',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -128,10 +128,10 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.avatarDecorations, title: i18n.ts.avatarDecorations,
icon: 'ti ti-sparkles', icon: 'ti ti-sparkles',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -45,8 +45,8 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.customCss, title: i18n.ts.customCss,
icon: 'ti ti-code', icon: 'ti ti-code',
}); }));
</script> </script>

View file

@ -36,8 +36,8 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.deck, title: i18n.ts.deck,
icon: 'ti ti-columns', icon: 'ti ti-columns',
}); }));
</script> </script>

View file

@ -117,10 +117,10 @@ function onContextMenu(ev: MouseEvent, file): void {
os.contextMenu(getDriveFileMenu(file), ev); os.contextMenu(getDriveFileMenu(file), ev);
} }
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.drivecleaner, title: i18n.ts.drivecleaner,
icon: 'ti ti-trash', icon: 'ti ti-trash',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -143,10 +143,10 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.drive, title: i18n.ts.drive,
icon: 'ti ti-cloud', icon: 'ti ti-cloud',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

View file

@ -113,8 +113,8 @@ const headerActions = computed(() => []);
const headerTabs = computed(() => []); const headerTabs = computed(() => []);
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.email, title: i18n.ts.email,
icon: 'ti ti-mail', icon: 'ti ti-mail',
}); }));
</script> </script>

View file

@ -237,10 +237,10 @@ watch(pinnedEmojis, () => {
deep: true, deep: true,
}); });
definePageMetadata({ definePageMetadata(() => ({
title: i18n.ts.emojiPicker, title: i18n.ts.emojiPicker,
icon: 'ti ti-mood-happy', icon: 'ti ti-mood-happy',
}); }));
</script> </script>
<style lang="scss" module> <style lang="scss" module>

Some files were not shown because too many files have changed in this diff Show more