うぃp
This commit is contained in:
parent
bf1738240a
commit
04fe0e6227
|
@ -12,7 +12,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
<a :href="`/@${user.username}`" target="_blank" rel="noopener noreferrer" :class="$style.avatarLink">
|
<a :href="`/@${user.username}`" target="_blank" rel="noopener noreferrer" :class="$style.avatarLink">
|
||||||
<MkAvatar :class="$style.avatar" :user="user"/>
|
<MkAvatar :class="$style.avatar" :user="user"/>
|
||||||
</a>
|
</a>
|
||||||
<div :class="$style.headerTitle" @click="top">
|
<div :class="$style.headerTitle">
|
||||||
<I18n :src="i18n.ts.noteOf" tag="div" class="_nowrap">
|
<I18n :src="i18n.ts.noteOf" tag="div" class="_nowrap">
|
||||||
<template #user>
|
<template #user>
|
||||||
<a v-if="user != null" :href="`/@${user.username}`" target="_blank" rel="noopener noreferrer">
|
<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 { i18n } from '@/i18n.js';
|
||||||
import { instance } from '@/instance.js';
|
import { instance } from '@/instance.js';
|
||||||
import { url, instanceName } from '@/config.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';
|
import { defaultEmbedParams } from '@/embed-page.js';
|
||||||
|
|
||||||
const props = defineProps<{
|
const props = defineProps<{
|
||||||
|
@ -78,15 +76,6 @@ const loading = ref(true);
|
||||||
|
|
||||||
const notesEl = shallowRef<InstanceType<typeof EmNotes> | null>(null);
|
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', {
|
misskeyApi('users/show', {
|
||||||
username: props.username,
|
username: props.username,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
|
|
|
@ -19,6 +19,8 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||||
:class="$style.routerViewContainer"
|
:class="$style.routerViewContainer"
|
||||||
>
|
>
|
||||||
<EmNotePage v-if="page === 'notes'" :noteId="contentId"/>
|
<EmNotePage v-if="page === 'notes'" :noteId="contentId"/>
|
||||||
|
<EmUserTimelinePage v-else-if="page === 'user-timeline'" :userId="contentId"/>
|
||||||
|
<XNotFound v-else/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -29,6 +31,7 @@ import type { ParsedEmbedParams } from '@/embed-page.js';
|
||||||
import { postMessageToParentWindow } from '@/post-message.js';
|
import { postMessageToParentWindow } from '@/post-message.js';
|
||||||
import { defaultEmbedParams } from '@/embed-page.js';
|
import { defaultEmbedParams } from '@/embed-page.js';
|
||||||
import EmNotePage from '@/pages/note.vue';
|
import EmNotePage from '@/pages/note.vue';
|
||||||
|
import EmUserTimelinePage from '@/pages/user-timeline.vue';
|
||||||
|
|
||||||
const page = location.pathname.split('/')[2];
|
const page = location.pathname.split('/')[2];
|
||||||
const contentId = location.pathname.split('/')[3];
|
const contentId = location.pathname.split('/')[3];
|
||||||
|
|
Loading…
Reference in New Issue