feat: mute note using plugin
This commit is contained in:
parent
4dd4a11cef
commit
5e3bd43e4c
|
|
@ -183,9 +183,11 @@ let note = $ref(deepClone(props.note));
|
||||||
// plugin
|
// plugin
|
||||||
if (noteViewInterruptors.length > 0) {
|
if (noteViewInterruptors.length > 0) {
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
let result = deepClone(note);
|
let result:Misskey.entities.Note | null = deepClone(note);
|
||||||
for (const interruptor of noteViewInterruptors) {
|
for (const interruptor of noteViewInterruptors) {
|
||||||
result = await interruptor.handler(result);
|
result = await interruptor.handler(result);
|
||||||
|
|
||||||
|
if (result === null) return isDeleted.value = true;
|
||||||
}
|
}
|
||||||
note = result;
|
note = result;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -230,9 +230,11 @@ let note = $ref(deepClone(props.note));
|
||||||
// plugin
|
// plugin
|
||||||
if (noteViewInterruptors.length > 0) {
|
if (noteViewInterruptors.length > 0) {
|
||||||
onMounted(async () => {
|
onMounted(async () => {
|
||||||
let result = deepClone(note);
|
let result:Misskey.entities.Note | null = deepClone(note);
|
||||||
for (const interruptor of noteViewInterruptors) {
|
for (const interruptor of noteViewInterruptors) {
|
||||||
result = await interruptor.handler(result);
|
result = await interruptor.handler(result);
|
||||||
|
|
||||||
|
if (result === null) return isDeleted.value = true;
|
||||||
}
|
}
|
||||||
note = result;
|
note = result;
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue