Skip to content

Commit

Permalink
[web][native] hide media gallery for thick threads
Browse files Browse the repository at this point in the history
Summary:
[ENG-9315](https://linear.app/comm/issue/ENG-9315/media-tab-is-empty-for-thick-threads-on-the-web).

Hiding media gallery for thick threads.

Test Plan:
1. On web and native this in not possible to access/see media gallery for thick threads.
1. For thin threads it works as previously.

Reviewers: tomek

Reviewed By: tomek

Subscribers: ashoat

Differential Revision: https://phab.comm.dev/D13448
  • Loading branch information
xsanm committed Sep 25, 2024
1 parent ecb034a commit 57b94fa
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
5 changes: 5 additions & 0 deletions native/chat/settings/thread-settings.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ import { threadPermissions } from 'lib/types/thread-permission-types.js';
import {
threadTypes,
threadTypeIsSidebar,
threadTypeIsThick,
} from 'lib/types/thread-types-enum.js';
import type { UserInfos } from 'lib/types/user-types.js';
import {
Expand Down Expand Up @@ -702,6 +703,10 @@ class ThreadSettings extends React.PureComponent<Props, State> {
const listData: ChatSettingsItem[] = [];
const limit = 6;

if (threadTypeIsThick(threadInfo.type)) {
return listData;
}

listData.push({
itemType: 'mediaGallery',
key: 'mediaGallery',
Expand Down
12 changes: 7 additions & 5 deletions web/chat/thread-menu.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,19 @@ function ThreadMenu(props: ThreadMenuProps): React.Node {
[popModal, pushModal, threadInfo],
);

const threadMediaGalleryItem = React.useMemo(
() => (
const threadMediaGalleryItem = React.useMemo(() => {
if (threadTypeIsThick(threadInfo.type)) {
return null;
}
return (
<MenuItem
key="threadMediaGallery"
text="Media"
icon="image-1"
onClick={onClickThreadMediaGallery}
/>
),
[onClickThreadMediaGallery],
);
);
}, [onClickThreadMediaGallery, threadInfo.type]);

const childThreads = useSelector(
state => childThreadInfos(state)[threadInfo.id],
Expand Down

0 comments on commit 57b94fa

Please sign in to comment.