Skip to content

Commit

Permalink
fix: word mute is not applied to sub note (#11711)
Browse files Browse the repository at this point in the history
* fix: word mute is not applied to sub note

* chore: update changelog

* chore: run eslint fix

---------

Co-authored-by: tamaina <[email protected]>
  • Loading branch information
paring-chan and tamaina authored Aug 14, 2023
1 parent ab58b65 commit c3fd848
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
- Fix: サーバー情報画面(`/instance-info/{domain}`)でブロックができないのを修正
- Fix: 未読のお知らせの「わかった」をクリック・タップしてもその場で「わかった」が消えない問題を修正
- Fix: iOSで画面を回転させるとテキストサイズが変わる問題を修正
- Fix: word mute for sub note is not applied
- Fix: タイムラインを下にスクロールしてノート画面に移動して再び戻ったら以前のスクロール位置を失う問題を修正

### Server
Expand Down
26 changes: 24 additions & 2 deletions packages/frontend/src/components/MkNoteSub.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>
<div :class="[$style.root, { [$style.children]: depth > 1 }]">
<div v-if="!muted" :class="[$style.root, { [$style.children]: depth > 1 }]">
<div :class="$style.main">
<div v-if="note.channel" :class="$style.colorBar" :style="{ background: note.channel.color }"></div>
<MkAvatar :class="$style.avatar" :user="note.user" link preview/>
Expand All @@ -28,10 +28,19 @@ SPDX-License-Identifier: AGPL-3.0-only
<MkA class="_link" :to="notePage(note)">{{ i18n.ts.continueThread }} <i class="ti ti-chevron-double-right"></i></MkA>
</div>
</div>
<div v-else :class="$style.muted" @click="muted = false">
<I18n :src="i18n.ts.userSaysSomething" tag="small">
<template #name>
<MkA v-user-preview="note.userId" :to="userPage(note.user)">
<MkUserName :user="note.user"/>
</MkA>
</template>
</I18n>
</div>
</template>

<script lang="ts" setup>
import { } from 'vue';
import { ref } from 'vue';
import * as misskey from 'misskey-js';
import MkNoteHeader from '@/components/MkNoteHeader.vue';
import MkSubNoteContent from '@/components/MkSubNoteContent.vue';
Expand All @@ -40,6 +49,9 @@ import { notePage } from '@/filters/note';
import * as os from '@/os';
import { i18n } from '@/i18n';
import { $i } from '@/account';
import { userPage } from "@/filters/user";
import { checkWordMute } from "@/scripts/check-word-mute";
import { defaultStore } from "@/store";

const props = withDefaults(defineProps<{
note: misskey.entities.Note;
Expand All @@ -51,6 +63,8 @@ const props = withDefaults(defineProps<{
depth: 1,
});

const muted = ref(checkWordMute(props.note, $i, defaultStore.state.mutedWords));

let showContent = $ref(false);
let replies: misskey.entities.Note[] = $ref([]);

Expand Down Expand Up @@ -139,4 +153,12 @@ if (props.detail) {
}
}
}

.muted {
text-align: center;
padding: 8px !important;
border: 1px solid var(--divider);
margin: 8px 8px 0 8px;
border-radius: 8px;
}
</style>

0 comments on commit c3fd848

Please sign in to comment.