fix adding View Raw to undesired channel context menus

This commit is contained in:
Vendicated 2024-01-09 17:39:38 +01:00
parent ba2695b499
commit ba6d23a31f
No known key found for this signature in database
GPG key ID: D66986BAF75ECF18
2 changed files with 11 additions and 5 deletions

View file

@ -126,7 +126,9 @@ function MenuItem(guildId: string, id?: string, type?: MenuItemParentType) {
function makeContextMenuPatch(childId: string | string[], type?: MenuItemParentType): NavContextMenuPatchCallback {
return (children, props) => () => {
if (!props || (type === MenuItemParentType.User && !props.user) || (type === MenuItemParentType.Guild && !props.guild)) return children;
if (!props) return;
if ((type === MenuItemParentType.User && !props.user) || (type === MenuItemParentType.Guild && !props.guild) || (type === MenuItemParentType.Channel && (!props.channel || !props.guild)))
return children;
const group = findGroupChildrenByChildId(childId, children);