upd: add support in frontend

This commit is contained in:
Insert5StarName 2023-09-22 22:33:18 +02:00
parent feec3c302b
commit dc10579950
7 changed files with 47 additions and 3 deletions

View file

@ -171,6 +171,18 @@ export function getNoteMenu(props: {
}
});
}
function edit(): void {
//os.api('notes/delete', {
// noteId: appearNote.id,
//});
os.post({
initialNote: appearNote,
renote: appearNote.renote,
reply: appearNote.reply,
channel: appearNote.channel,
editId: appearNote.id,
});
}
function toggleFavorite(favorite: boolean): void {
claimAchievement('noteFavorited1');
@ -353,10 +365,17 @@ export function getNoteMenu(props: {
...(appearNote.userId === $i.id || $i.isModerator || $i.isAdmin ? [
null,
appearNote.userId === $i.id ? {
icon: 'ti ti-pencil',
text: i18n.ts.edit,
danger: true,
action: edit,
}: undefined,
{
icon: 'ti ti-edit',
text: i18n.ts.deleteAndEdit,
danger: true,
action: delEdit,
} : undefined,
},
{
icon: 'ti ti-trash',
text: i18n.ts.delete,