mirror of
https://github.com/revoltchat/revite.git
synced 2024-11-22 07:00:58 -05:00
fix: move leave/delete server option to the bottom
This commit is contained in:
parent
e53059ee08
commit
f03a88bd78
1 changed files with 27 additions and 10 deletions
|
@ -974,6 +974,10 @@ export default function ContextMenus() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// workaround to prevent button duplication
|
||||||
|
let hideIDButton;
|
||||||
|
if (sid && server) hideIDButton = true;
|
||||||
|
|
||||||
if (sid && server) {
|
if (sid && server) {
|
||||||
generateAction(
|
generateAction(
|
||||||
{
|
{
|
||||||
|
@ -1015,15 +1019,28 @@ export default function ContextMenus() {
|
||||||
"open_server_settings",
|
"open_server_settings",
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// workaround to move this above the delete/leave button
|
||||||
|
generateAction(
|
||||||
|
{ action: "copy_id", id },
|
||||||
|
"copy_sid",
|
||||||
|
);
|
||||||
|
|
||||||
|
pushDivider();
|
||||||
if (userId === server.owner) {
|
if (userId === server.owner) {
|
||||||
generateAction(
|
generateAction(
|
||||||
{ action: "delete_server", target: server },
|
{ action: "delete_server", target: server },
|
||||||
"delete_server",
|
"delete_server",
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
"var(--error)",
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
generateAction(
|
generateAction(
|
||||||
{ action: "leave_server", target: server },
|
{ action: "leave_server", target: server },
|
||||||
"leave_server",
|
"leave_server",
|
||||||
|
undefined,
|
||||||
|
undefined,
|
||||||
|
"var(--error)",
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1035,16 +1052,16 @@ export default function ContextMenus() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
generateAction(
|
if (!hideIDButton) {
|
||||||
{ action: "copy_id", id },
|
generateAction(
|
||||||
sid
|
{ action: "copy_id", id },
|
||||||
? "copy_sid"
|
cid
|
||||||
: cid
|
? "copy_cid"
|
||||||
? "copy_cid"
|
: message
|
||||||
: message
|
? "copy_mid"
|
||||||
? "copy_mid"
|
: "copy_uid",
|
||||||
: "copy_uid",
|
);
|
||||||
);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return elements;
|
return elements;
|
||||||
|
|
Loading…
Reference in a new issue