Compare commits

...

2 commits

Author SHA1 Message Date
daae1ec300
client: better error for already clipped note
Changelog: Fixed
2025-02-06 20:06:08 +01:00
f1b344c5e7
client: more actions for renotes
Also allows to perform most note actions on renotes.

Changelog: Added
2025-02-06 20:06:07 +01:00
2 changed files with 14 additions and 17 deletions

View file

@ -24,7 +24,7 @@
</I18n>
<div class="info">
<button ref="renoteTime" class="_button time" @click="showRenoteMenu()">
<i v-if="isMyRenote" class="fas fa-ellipsis-h dropdownIcon"></i>
<i class="fas fa-ellipsis-h dropdownIcon"></i>
<MkTime :time="note.createdAt"/>
</button>
<MkVisibility :note="note"/>
@ -154,7 +154,6 @@ const renoteButton = ref<InstanceType<typeof XRenoteButton>>();
const renoteTime = ref<HTMLElement>();
const reactButton = ref<HTMLElement>();
let appearNote = $computed(() => isRenote ? note.renote as foundkey.entities.Note : note);
const isMyRenote = $i && ($i.id === note.userId);
const showContent = ref(false);
const isLong = (appearNote.cw == null && appearNote.text != null && (
(appearNote.text.split('\n').length > 9) ||
@ -244,20 +243,18 @@ function menu(viaKeyboard = false): void {
}
function showRenoteMenu(viaKeyboard = false): void {
if (!isMyRenote) return;
os.popupMenu([{
text: i18n.ts.unrenote,
icon: 'fas fa-trash-alt',
danger: true,
action: () => {
os.api('notes/delete', {
noteId: note.id,
});
isDeleted.value = true;
},
}], renoteTime.value, {
viaKeyboard,
});
os.popupMenu(
getNoteMenu({
note,
translating,
translation,
renoteTime,
isDeleted,
currentClipPage
}),
renoteTime.value,
{ viaKeyboard },
);
}
function focus() {

View file

@ -146,7 +146,7 @@ export function getNoteMenu(props: {
os.api('clips/add-note', { clipId: clip.id, noteId: props.note.id }),
null,
async (err) => {
if (err.id === 'ALREADY_CLIPPED') {
if (err.code === 'ALREADY_CLIPPED') {
const confirm = await os.confirm({
type: 'warning',
text: i18n.t('confirmToUnclipAlreadyClippedNote', { name: clip.name }),