Skip to content

Commit

Permalink
fix(frontend-embed): fix instanceticker, remove directives (misskey-d…
Browse files Browse the repository at this point in the history
  • Loading branch information
kakkokari-gtyih authored Sep 25, 2024
1 parent 8c3be57 commit 0f8b15f
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/frontend-embed/src/components/EmInstanceTicker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ const props = defineProps<{
// if no instance data is given, this is for the local instance
const instance = props.instance ?? {
name: serverMetadata.name,
themeColor: (document.querySelector('meta[name="theme-color-orig"]') as HTMLMetaElement).content,
themeColor: (document.querySelector('meta[name="theme-color-orig"]') as HTMLMetaElement)?.content,
};
const faviconUrl = computed(() => props.instance ? mediaProxy.getProxiedImageUrlNullable(props.instance.faviconUrl, 'preview') : mediaProxy.getProxiedImageUrlNullable(serverMetadata.iconUrl, 'preview') ?? '/favicon.ico');
const themeColor = serverMetadata.themeColor ?? '#777777';
const themeColor = props.instance?.themeColor ?? serverMetadata.themeColor ?? '#777777';
const bg = {
background: `linear-gradient(90deg, ${themeColor}, ${themeColor}00)`,
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend-embed/src/components/EmMention.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ SPDX-License-Identifier: AGPL-3.0-only
-->

<template>
<MkA v-user-preview="canonical" :class="[$style.root]" :to="url" :style="{ background: bgCss }">
<MkA :class="[$style.root]" :to="url" :style="{ background: bgCss }">
<span>
<span>@{{ username }}</span>
<span v-if="(host != localHost)" :class="$style.host">@{{ toUnicode(host) }}</span>
Expand Down
4 changes: 3 additions & 1 deletion packages/frontend-embed/src/components/EmNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<i class="ti ti-repeat" style="margin-right: 4px;"></i>
<I18n :src="i18n.ts.renotedBy" tag="span" :class="$style.renoteText">
<template #user>
<EmA v-user-preview="true ? undefined : note.userId" :class="$style.renoteUserName" :to="userPage(note.user)">
<EmA :class="$style.renoteUserName" :to="userPage(note.user)">
<EmUserName :user="note.user"/>
</EmA>
</template>
Expand All @@ -44,6 +44,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<EmAvatar :class="$style.avatar" :user="appearNote.user" link/>
<div :class="$style.main">
<EmNoteHeader :note="appearNote" :mini="true"/>
<EmInstanceTicker v-if="appearNote.user.instance != null" :instance="appearNote.user.instance"/>
<div style="container-type: inline-size;">
<p v-if="appearNote.cw != null" :class="$style.cw">
<EmMfm v-if="appearNote.cw != ''" style="margin-right: 8px;" :text="appearNote.cw" :author="appearNote.user" :nyaize="'respect'"/>
Expand Down Expand Up @@ -111,6 +112,7 @@ import I18n from '@/components/I18n.vue';
import EmNoteSub from '@/components/EmNoteSub.vue';
import EmNoteHeader from '@/components/EmNoteHeader.vue';
import EmNoteSimple from '@/components/EmNoteSimple.vue';
import EmInstanceTicker from '@/components/EmInstanceTicker.vue';
import EmReactionsViewer from '@/components/EmReactionsViewer.vue';
import EmMediaList from '@/components/EmMediaList.vue';
import EmPoll from '@/components/EmPoll.vue';
Expand Down
2 changes: 2 additions & 0 deletions packages/frontend-embed/src/components/EmNoteDetailed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</a>
</div>
</div>
<EmInstanceTicker v-if="appearNote.user.instance != null" :instance="appearNote.user.instance"/>
</div>
</header>
<div :class="[$style.noteContent, { [$style.contentCollapsed]: collapsed }]">
Expand Down Expand Up @@ -132,6 +133,7 @@ import I18n from '@/components/I18n.vue';
import EmMediaList from '@/components/EmMediaList.vue';
import EmNoteSub from '@/components/EmNoteSub.vue';
import EmNoteSimple from '@/components/EmNoteSimple.vue';
import EmInstanceTicker from '@/components/EmInstanceTicker.vue';
import EmReactionsViewer from '@/components/EmReactionsViewer.vue';
import EmPoll from '@/components/EmPoll.vue';
import EmA from '@/components/EmA.vue';
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend-embed/src/components/EmNoteHeader.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<div v-if="note.user.isBot" :class="$style.isBot">bot</div>
<div :class="$style.username"><EmAcct :user="note.user"/></div>
<div v-if="note.user.badgeRoles" :class="$style.badgeRoles">
<img v-for="(role, i) in note.user.badgeRoles" :key="i" v-tooltip="role.name" :class="$style.badgeRole" :src="role.iconUrl!"/>
<img v-for="(role, i) in note.user.badgeRoles" :key="i" :class="$style.badgeRole" :src="role.iconUrl!"/>
</div>
<div :class="$style.info">
<EmA :to="notePage(note)">
Expand Down

0 comments on commit 0f8b15f

Please sign in to comment.