Skip to content

Commit a010612

Browse files
fix review
1 parent 0212996 commit a010612

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

‎packages/frontend/src/components/MkEmojiPicker.vue‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,8 +222,8 @@ const customEmojiFolderRoot = computed(() => {
222222
return root;
223223
});
224224
225-
watch(q, () => {
226-
if (emojisEl.value) emojisEl.value.scrollTop = 0;
225+
watch([q, customEmojis], (_, [oldQ]) => {
226+
if (q.value !== oldQ && emojisEl.value) emojisEl.value.scrollTop = 0;
227227
228228
if (q.value === '') {
229229
searchResultCustom.value = [];

‎packages/frontend/src/components/global/MkCustomEmoji.vue‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ SPDX-License-Identifier: AGPL-3.0-only
3737
</template>
3838

3939
<script lang="ts" setup>
40-
import { computed, defineAsyncComponent, inject, ref } from 'vue';
40+
import { computed, defineAsyncComponent, inject, ref, watch } from 'vue';
4141
import { normalizeCustomEmojiName, isLocalCustomEmojiName, getCustomEmojiImagePath } from '@@/js/emoji-name.js';
4242
import type { MenuItem } from '@/types/menu.js';
4343
import { getProxiedImageUrl, getStaticImageUrl } from '@/utility/media-proxy.js';
@@ -104,6 +104,11 @@ const url = computed(() => {
104104
const alt = computed(() => `:${customEmojiName.value}:`);
105105
const errored = ref(url.value == null);
106106
107+
watch(url, (newUrl) => {
108+
// 絵文字一覧の更新などでURLが変わったら読み込みを再試行する
109+
errored.value = (newUrl == null);
110+
});
111+
107112
function onClick(ev: PointerEvent) {
108113
if (props.menu) {
109114
const menuItems: MenuItem[] = [];

0 commit comments

Comments
 (0)