fix: edit and delete context menu items not showing up on your own messages caused by use of member uuid instead of user uuid comparison
All checks were successful
ci/woodpecker/push/build-and-publish Pipeline was successful

This commit is contained in:
SauceyRed 2025-08-05 22:40:16 +02:00
parent 5b0f358829
commit d1f67d894d
Signed by: sauceyred
GPG key ID: 2BF92EB6D8A5CCA7

View file

@ -149,12 +149,12 @@ const menuItems: ContextMenuItem[] = [
] ]
console.log("me:", props.me); console.log("me:", props.me);
if (props.author?.uuid == props.me.uuid) { if (props.author?.user.uuid == props.me.uuid) {
// Inserts "edit" option at index 1 (below the "reply" option) // Inserts "edit" option at index 1 (below the "reply" option)
menuItems.splice(1, 0, { name: "Edit (WIP)", icon: "lucide:square-pen", type: "normal", callback: () => { /* if (messageElement.value) editMessage(messageElement.value, props) */ } }); menuItems.splice(1, 0, { name: "Edit (WIP)", icon: "lucide:square-pen", type: "normal", callback: () => { /* if (messageElement.value) editMessage(messageElement.value, props) */ } });
} }
if (props.author?.uuid == props.me.uuid /* || check message delete permission*/) { if (props.author?.user.uuid == props.me.uuid /* || check message delete permission*/) {
// Inserts "edit" option at index 2 (below the "edit" option) // Inserts "edit" option at index 2 (below the "edit" option)
menuItems.splice(2, 0, { name: "Delete (WIP)", icon: "lucide:trash", type: "danger", callback: () => {} }); menuItems.splice(2, 0, { name: "Delete (WIP)", icon: "lucide:trash", type: "danger", callback: () => {} });
} }