Frontend: Hopefully fixed emoji resolution
ci/woodpecker/push/ociImagePush Pipeline was successful Details

This commit is contained in:
Natty 2023-11-06 02:09:06 +01:00
parent b4611bda78
commit cb645ef0f6
Signed by: natty
GPG Key ID: BF6CB659ADEE60EC
3 changed files with 19 additions and 6 deletions

View File

@ -17,7 +17,10 @@
:custom-emojis="[
...note.emojis,
typeof url !== 'undefined'
? { name: reaction, url: url }
? {
name: reaction.substring(1, reaction.length - 1),
url: url,
}
: undefined,
]"
/>

View File

@ -27,12 +27,17 @@ import { getStaticImageUrl } from "@/scripts/get-static-image-url";
import { char2filePath } from "@/scripts/twemoji-base";
import { defaultStore } from "@/store";
import { instance } from "@/instance";
import { packed } from "magnetar-common";
import { magTransProperty } from "@/scripts-mag/mag-util";
const props = defineProps<{
emoji: string;
normal?: boolean;
noStyle?: boolean;
customEmojis?: Pick<Misskey.entities.CustomEmoji, "name" | "url">[];
customEmojis?: (
| packed.PackEmojiBase
| Pick<Misskey.entities.CustomEmoji, "name" | "url">
)[];
isReaction?: boolean;
}>();
@ -45,7 +50,9 @@ const ce = computed(() => props.customEmojis ?? instance.emojis ?? []);
const customEmoji = computed(() =>
isCustom.value
? ce.value.find(
(x) => x.name === props.emoji.substring(1, props.emoji.length - 1)
(x) =>
magTransProperty(x, "shortcode", "name") ===
props.emoji.substring(1, props.emoji.length - 1)
)
: null
);
@ -61,7 +68,9 @@ const url = computed(() => {
}
});
const alt = computed(() =>
customEmoji.value ? `:${customEmoji.value.name}:` : char.value
customEmoji.value
? `:${magTransProperty(customEmoji.value, "shortcode", "name")}:`
: char.value
);
</script>

View File

@ -15,9 +15,10 @@
</template>
<script lang="ts" setup>
import {} from "vue";
import MfmCore from "@/components/mfm";
import { defaultStore } from "@/store";
import * as Misskey from "calckey-js";
import { packed } from "magnetar-common";
const props = withDefaults(
defineProps<{
@ -25,7 +26,7 @@ const props = withDefaults(
plain?: boolean;
nowrap?: boolean;
author?: any;
customEmojis?: any;
customEmojis?: (packed.PackEmojiBase | Misskey.entities.CustomEmoji)[];
isNote?: boolean;
advancedMfm: boolean;
}>(),