enhance(frontend): ミュートした絵文字をデバイス間で同期できるように

Resolve #16158
This commit is contained in:
syuilo 2025-06-04 12:01:33 +09:00
parent d94bdff639
commit b766589c00
3 changed files with 50 additions and 23 deletions

View File

@ -7,6 +7,7 @@
- Feat: 画像にウォーターマークを付与できるようになりました
- Enhance: ノートのリアクション一覧で、押せるリアクションを優先して表示できるようにするオプションを追加
- Enhance: 全てのチャットメッセージを既読にできるように(設定→その他)
- Enhance: ミュートした絵文字をデバイス間で同期できるように
- Fix: ドライブファイルの選択が不安定な問題を修正
- Fix: コントロールパネルのファイル欄などのデザインが崩れている問題を修正
- Fix: ユーザーの検索結果を追加で読み込むことができない問題を修正

View File

@ -4,7 +4,8 @@ SPDX-License-Identifier: AGPL-3.0-only
-->
<template>
<div :class="$style.emojis">
<div class="_gaps_m">
<div :class="$style.emojis">
<div v-for="emoji in emojis" :key="`emojiMute-${emoji}`" :class="$style.emoji" @click="onEmojiClick($event, emoji)">
<MkCustomEmoji
v-if="emoji.startsWith(':')"
@ -23,14 +24,25 @@ SPDX-License-Identifier: AGPL-3.0-only
:ignoreMuted="true"
></MkEmoji>
</div>
</div>
</div>
<MkButton primary inline @click="add"><i class="ti ti-plus"></i> {{ i18n.ts.add }}</MkButton>
<MkButton primary inline @click="add"><i class="ti ti-plus"></i> {{ i18n.ts.add }}</MkButton>
<hr>
<SearchMarker :keywords="['sync', 'devices']">
<MkSwitch :modelValue="syncEnabled" @update:modelValue="changeSyncEnabled">
<template #label><i class="ti ti-cloud-cog"></i> <SearchLabel>{{ i18n.ts.syncBetweenDevices }}</SearchLabel></template>
</MkSwitch>
</SearchMarker>
</div>
</template>
<script lang="ts" setup>
import { ref } from 'vue';
import type { MenuItem } from '@/types/menu';
import MkButton from '@/components/MkButton.vue';
import MkSwitch from '@/components/MkSwitch.vue';
import * as os from '@/os.js';
import { i18n } from '@/i18n.js';
import { prefer } from '@/preferences.js';
@ -79,7 +91,23 @@ function unmute(emoji: string) {
unmuteEmoji(emoji);
});
}
const syncEnabled = ref(prefer.isSyncEnabled('mutingEmojis'));
function changeSyncEnabled(value: boolean) {
if (value) {
prefer.enableSync('mutingEmojis').then((res) => {
if (res == null) return;
if (res.enabled) syncEnabled.value = true;
});
} else {
prefer.disableSync('mutingEmojis');
syncEnabled.value = false;
}
}
</script>
<style module>
.emojis {
display: flex;

View File

@ -57,9 +57,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<template #icon><i class="ti ti-mood-off"></i></template>
<template #label>{{ i18n.ts.emojiMute }}</template>
<div class="_gaps_m">
<XEmojiMute/>
</div>
</mkfolder>
</SearchMarker>