うぃp

This commit is contained in:
syuilo 2024-08-28 12:38:52 +09:00
parent bf1738240a
commit 04fe0e6227
2 changed files with 4 additions and 12 deletions

View File

@ -12,7 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<a :href="`/@${user.username}`" target="_blank" rel="noopener noreferrer" :class="$style.avatarLink">
<MkAvatar :class="$style.avatar" :user="user"/>
</a>
<div :class="$style.headerTitle" @click="top">
<div :class="$style.headerTitle">
<I18n :src="i18n.ts.noteOf" tag="div" class="_nowrap">
<template #user>
<a v-if="user != null" :href="`/@${user.username}`" target="_blank" rel="noopener noreferrer">
@ -57,8 +57,6 @@ import { misskeyApi } from '@/misskey-api.js';
import { i18n } from '@/i18n.js';
import { instance } from '@/instance.js';
import { url, instanceName } from '@/config.js';
import { scrollToTop } from '@/to-be-shared/scroll.js';
import { isLink } from '@/scripts/is-link.js';
import { defaultEmbedParams } from '@/embed-page.js';
const props = defineProps<{
@ -78,15 +76,6 @@ const loading = ref(true);
const notesEl = shallowRef<InstanceType<typeof EmNotes> | null>(null);
function top(ev: MouseEvent) {
const target = ev.target as HTMLElement | null;
if (target && isLink(target)) return;
if (notesEl.value) {
scrollToTop(notesEl.value.$el as HTMLElement, { behavior: 'smooth' });
}
}
misskeyApi('users/show', {
username: props.username,
}).then(res => {

View File

@ -19,6 +19,8 @@ SPDX-License-Identifier: AGPL-3.0-only
:class="$style.routerViewContainer"
>
<EmNotePage v-if="page === 'notes'" :noteId="contentId"/>
<EmUserTimelinePage v-else-if="page === 'user-timeline'" :userId="contentId"/>
<XNotFound v-else/>
</div>
</div>
</template>
@ -29,6 +31,7 @@ import type { ParsedEmbedParams } from '@/embed-page.js';
import { postMessageToParentWindow } from '@/post-message.js';
import { defaultEmbedParams } from '@/embed-page.js';
import EmNotePage from '@/pages/note.vue';
import EmUserTimelinePage from '@/pages/user-timeline.vue';
const page = location.pathname.split('/')[2];
const contentId = location.pathname.split('/')[3];