Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile Web view : I am not able to create a new category #23619

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions webapp/channels/src/components/menu/menu.tsx
Expand Up @@ -66,6 +66,7 @@
menuButtonTooltip?: MenuButtonTooltipProps;
menu: MenuProps;
children: ReactNode[];
onMenuModalClose: () => void

Check failure on line 69 in webapp/channels/src/components/menu/menu.tsx

View workflow job for this annotation

GitHub Actions / pr-ci / check-lint

Expected a semicolon
}

/**
Expand Down Expand Up @@ -98,6 +99,7 @@
function handleMenuModalClose(modalId: MenuProps['id']) {
dispatch(closeModal(modalId));
setAnchorElement(null);
props.onMenuModalClose();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i am curious why did we had to pass this another close function when we already have dispatch(closeModal(modalId)); on the line above

}

function handleMenuClick() {
Expand Down
Expand Up @@ -39,6 +39,7 @@ type Props = OwnProps & PropsFromRedux;

const SidebarCategoryMenu = (props: Props) => {
const [isMenuOpen, setIsMenuOpen] = useState(false);
const [isCloseMenuManually, setIsCloseMenuManually] = useState(false);

const {formatMessage} = useIntl();

Expand Down Expand Up @@ -217,6 +218,7 @@ const SidebarCategoryMenu = (props: Props) => {
dialogType: EditCategoryModal,
});
trackEvent('ui', 'ui_sidebar_category_menu_createCategory');
setIsCloseMenuManually(true);
}

const createNewCategoryMenuItem = (
Expand All @@ -238,6 +240,10 @@ const SidebarCategoryMenu = (props: Props) => {
setIsMenuOpen(isOpen);
}

function onMenuModalClose() {
setIsCloseMenuManually(false);
}

return (
<div
className={classNames(
Expand Down Expand Up @@ -265,7 +271,9 @@ const SidebarCategoryMenu = (props: Props) => {
id: `SidebarChannelMenu-MenuList-${props.category.id}`,
'aria-label': formatMessage({id: 'sidebar_left.sidebar_category_menu.dropdownAriaLabel', defaultMessage: 'Edit category menu'}),
onToggle: handleMenuToggle,
closeMenuManually: isCloseMenuManually,
}}
onMenuModalClose={onMenuModalClose}
>
{muteUnmuteCategoryMenuItem}
{renameCategoryMenuItem}
Expand Down