fix: use computed instead of watch
This commit is contained in:
parent
2b1bcdabd5
commit
c490c7558f
2 changed files with 3 additions and 15 deletions
|
|
@ -295,7 +295,7 @@ const quoted = ref(false);
|
|||
const muted = ref($i ? checkWordMute(appearNote, $i, $i.mutedWords) : false);
|
||||
const translation = ref(null);
|
||||
const translating = ref(false);
|
||||
let parsed = appearNote.text ? mfm.parse(appearNote.text) : null;
|
||||
const parsed = $computed(() => appearNote.text ? mfm.parse(appearNote.text) : null);
|
||||
const urls = parsed ? extractUrlFromMfm(parsed) : null;
|
||||
const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.user.instance);
|
||||
const conversation = ref<Misskey.entities.Note[]>([]);
|
||||
|
|
@ -307,12 +307,6 @@ watch(() => props.expandAllCws, (expandAllCws) => {
|
|||
if (expandAllCws !== showContent.value) showContent.value = expandAllCws;
|
||||
});
|
||||
|
||||
watch(() => appearNote.text, () => {
|
||||
if (appearNote.text && mfm.parse(appearNote.text) !== parsed) {
|
||||
parsed = mfm.parse(appearNote.text);
|
||||
}
|
||||
});
|
||||
|
||||
if ($i) {
|
||||
os.api("notes/renotes", {
|
||||
noteId: appearNote.id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue