Skip to content

Commit

Permalink
fix: fixed menuItemsCreator timing
Browse files Browse the repository at this point in the history
  • Loading branch information
bang9 committed May 11, 2023
1 parent c8402af commit 279fd98
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const GroupChannelSettingsMenu = ({
};
});

const menuItems: MenuBarProps[] = menuItemsCreator([
const defaultMenuItems: MenuBarProps[] = [
{
icon: 'moderation',
visible: channel.myRole === 'operator',
Expand All @@ -95,17 +95,17 @@ const GroupChannelSettingsMenu = ({
actionLabel: String(channel.memberCount),
actionItem: <Icon icon={'chevron-right'} color={colors.onBackground01} />,
},
]);
];

if (features.messageSearchEnabled) {
menuItems.push({
defaultMenuItems.push({
icon: 'search',
name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_SEARCH,
onPress: () => onPressMenuSearchInChannel?.(),
});
}

menuItems.push({
defaultMenuItems.push({
icon: 'leave',
iconColor: colors.error,
name: STRINGS.GROUP_CHANNEL_SETTINGS.MENU_LEAVE_CHANNEL,
Expand All @@ -117,6 +117,8 @@ const GroupChannelSettingsMenu = ({
},
});

const menuItems = menuItemsCreator(defaultMenuItems);

return (
<View>
{menuItems.map((menu) => {
Expand Down

0 comments on commit 279fd98

Please sign in to comment.