viewRaw, viewIcons, permissionsViewer: fix some edge cases (#1745)

Co-authored-by: V <vendicated@riseup.net>
This commit is contained in:
AutumnVN 2023-09-26 06:48:09 +07:00 committed by GitHub
parent 4c7a2ba340
commit f32d25b641
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View file

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