Merge remote-tracking branch 'origin/schedule-note' into schedule-note

This commit is contained in:
mattyatea 2023-11-09 18:37:09 +09:00
commit 8a735c23e7
No known key found for this signature in database
GPG key ID: 068E54E2C33BEF9A
7 changed files with 49 additions and 16 deletions

View file

@ -202,11 +202,17 @@ let note = $ref(deepClone(props.note));
// plugin
if (noteViewInterruptors.length > 0) {
onMounted(async () => {
let result:Misskey.entities.Note | null = deepClone(note);
let result: Misskey.entities.Note | null = deepClone(note);
for (const interruptor of noteViewInterruptors) {
result = await interruptor.handler(result);
if (result === null) return isDeleted.value = true;
try {
result = await interruptor.handler(result);
if (result === null) {
isDeleted.value = true;
return;
}
} catch (err) {
console.error(err);
}
}
note = result;
});
@ -298,7 +304,7 @@ function renote(viaKeyboard = false) {
const { menu } = getRenoteMenu({ note: note, renoteButton, mock: props.mock });
os.popupMenu(menu, renoteButton.value, {
viaKeyboard,
}).then(focus);
});
}
function reply(viaKeyboard = false): void {

View file

@ -239,11 +239,17 @@ let note = $ref(deepClone(props.note));
// plugin
if (noteViewInterruptors.length > 0) {
onMounted(async () => {
let result:Misskey.entities.Note | null = deepClone(note);
let result: Misskey.entities.Note | null = deepClone(note);
for (const interruptor of noteViewInterruptors) {
result = await interruptor.handler(result);
if (result === null) return isDeleted.value = true;
try {
result = await interruptor.handler(result);
if (result === null) {
isDeleted.value = true;
return;
}
} catch (err) {
console.error(err);
}
}
note = result;
});
@ -344,7 +350,7 @@ function renote(viaKeyboard = false) {
const { menu } = getRenoteMenu({ note: note, renoteButton });
os.popupMenu(menu, renoteButton.value, {
viaKeyboard,
}).then(focus);
});
}
function reply(viaKeyboard = false): void {

View file

@ -770,7 +770,11 @@ async function post(ev?: MouseEvent) {
// plugin
if (notePostInterruptors.length > 0) {
for (const interruptor of notePostInterruptors) {
postData = await interruptor.handler(deepClone(postData));
try {
postData = await interruptor.handler(deepClone(postData));
} catch (err) {
console.error(err);
}
}
}