1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-11-27 22:38:30 +09:00

Merge branch 'io' into bun

This commit is contained in:
まっちゃとーにゅ 2024-10-20 12:42:51 +09:00
commit 7aad23ad13
No known key found for this signature in database
GPG Key ID: 6AFBBF529601C1DB
2 changed files with 11 additions and 6 deletions

View File

@ -171,7 +171,10 @@ SPDX-License-Identifier: AGPL-3.0-only
<span style="margin-left: 4px;">{{ appearNote.reactions[reaction] }}</span> <span style="margin-left: 4px;">{{ appearNote.reactions[reaction] }}</span>
</button> </button>
</div> </div>
<MkButton v-if="reactionTabType" :class="$style.reactionMuteButton" @click="reactionMuteToggle(reactionTabType)"> <i :class="!mutedReactions.includes(reactionTabType) ? 'ti ti-mood-happy' : 'ti ti-mood-off'"></i> {{ !mutedReactions.includes(reactionTabType) ? i18n.ts.muteThisReaction : i18n.ts.unmuteThisReaction }} </MkButton> <MkButton v-if="reactionTabType" :class="$style.reactionMuteButton" @click="reactionMuteToggle(reactionTabTypeTrimLocal)">
<i :class="!mutedReactions.includes(reactionTabTypeTrimLocal) ? 'ti ti-mood-happy' : 'ti ti-mood-off'"/>
{{ !mutedReactions.includes(reactionTabTypeTrimLocal) ? i18n.ts.muteThisReaction : i18n.ts.unmuteThisReaction }}
</MkButton>
<MkPagination v-if="reactionTabType" :key="reactionTabType" :pagination="reactionsPagination" :disableAutoLoad="true"> <MkPagination v-if="reactionTabType" :key="reactionTabType" :pagination="reactionsPagination" :disableAutoLoad="true">
<template #default="{ items }"> <template #default="{ items }">
<div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); grid-gap: 12px;"> <div style="display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); grid-gap: 12px;">
@ -314,6 +317,7 @@ provide('react', (reaction: string) => {
const tab = ref(props.initialTab); const tab = ref(props.initialTab);
const reactionTabType = ref<string | null>(null); const reactionTabType = ref<string | null>(null);
const reactionTabTypeTrimLocal = computed(() => reactionTabType.value?.replace('@.', '') ?? null);
const renotesPagination = computed<Paging>(() => ({ const renotesPagination = computed<Paging>(() => ({
endpoint: 'notes/renotes', endpoint: 'notes/renotes',
@ -484,12 +488,14 @@ async function clip() {
os.popupMenu(await getNoteClipMenu({ note: note.value, isDeleted }), clipButton.value).then(focus); os.popupMenu(await getNoteClipMenu({ note: note.value, isDeleted }), clipButton.value).then(focus);
} }
async function reactionMuteToggle(emojiName: string) { async function reactionMuteToggle(reactionName: string | null) {
if (!mutedReactions.value.includes(emojiName)) { if (reactionName == null) return;
mutedReactions.value.push(emojiName);
if (!mutedReactions.value.includes(reactionName)) {
mutedReactions.value.push(reactionName);
defaultStore.set('mutedReactions', mutedReactions.value); defaultStore.set('mutedReactions', mutedReactions.value);
} else { } else {
mutedReactions.value = mutedReactions.value.filter(x => x !== emojiName); mutedReactions.value = mutedReactions.value.filter(x => x !== reactionName);
defaultStore.set('mutedReactions', mutedReactions.value); defaultStore.set('mutedReactions', mutedReactions.value);
} }
} }

View File

@ -197,7 +197,6 @@ function remove(itemsRef: Ref<string[]>, reaction: string, ev: MouseEvent) {
async function pickEmoji(itemsRef: Ref<string[]>, ev: MouseEvent) { async function pickEmoji(itemsRef: Ref<string[]>, ev: MouseEvent) {
os.pickEmoji(ev.currentTarget ?? ev.target, { os.pickEmoji(ev.currentTarget ?? ev.target, {
showPinned: false, showPinned: false,
manualReactionInput: true,
}).then(it => { }).then(it => {
const emoji = it; const emoji = it;
if (!itemsRef.value.includes(emoji)) { if (!itemsRef.value.includes(emoji)) {