Skip to content

Commit

Permalink
Merge pull request #19829 from Expensify/stites-removeThreadsBeta
Browse files Browse the repository at this point in the history
Remove threads beta
  • Loading branch information
cristipaval authored Jun 1, 2023
2 parents 09a4deb + d586e53 commit 145dd4b
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 23 deletions.
9 changes: 0 additions & 9 deletions src/libs/Permissions.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,14 +102,6 @@ function canUseTasks(betas) {
return _.contains(betas, CONST.BETAS.TASKS) || _.contains(betas, CONST.BETAS.ALL);
}

/**
* @param {Array<String>} betas
* @returns {Boolean}
*/
function canUseThreads(betas) {
return _.contains(betas, CONST.BETAS.THREADS) || canUseAllBetas(betas);
}

export default {
canUseChronos,
canUseIOU,
Expand All @@ -122,5 +114,4 @@ export default {
canUsePolicyExpenseChat,
canUsePasswordlessLogins,
canUseTasks,
canUseThreads,
};
5 changes: 1 addition & 4 deletions src/pages/home/report/ContextMenu/ContextMenuActions.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,10 +119,7 @@ export default [
successTextTranslateKey: '',
successIcon: null,
shouldShow: (type, reportAction, isArchivedRoom, betas, anchor, isChronosReport, reportID) =>
Permissions.canUseThreads(betas) &&
type === CONTEXT_MENU_TYPES.REPORT_ACTION &&
reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT &&
!ReportUtils.isThreadFirstChat(reportAction, reportID),
type === CONTEXT_MENU_TYPES.REPORT_ACTION && reportAction.actionName === CONST.REPORT.ACTIONS.TYPE.ADDCOMMENT && !ReportUtils.isThreadFirstChat(reportAction, reportID),
onPress: (closePopover, {reportAction, reportID}) => {
Report.navigateToAndOpenChildReport(lodashGet(reportAction, 'childReportID', '0'), reportAction, reportID);
if (closePopover) {
Expand Down
11 changes: 1 addition & 10 deletions src/pages/home/report/ReportActionItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ import ReportPreview from '../../../components/ReportActionItem/ReportPreview';
import ReportActionItemDraft from './ReportActionItemDraft';
import TaskPreview from '../../../components/ReportActionItem/TaskPreview';
import TaskAction from '../../../components/ReportActionItem/TaskAction';
import Permissions from '../../../libs/Permissions';
import * as Session from '../../../libs/actions/Session';
import {hideContextMenu} from './ContextMenu/ReportActionContextMenu';

Expand Down Expand Up @@ -92,9 +91,6 @@ const propTypes = {

/** All of the personalDetails */
personalDetails: PropTypes.objectOf(personalDetailsPropType),

/** List of betas available to current user */
betas: PropTypes.arrayOf(PropTypes.string),
};

const defaultProps = {
Expand All @@ -103,7 +99,6 @@ const defaultProps = {
personalDetails: {},
shouldShowSubscriptAvatar: false,
hasOutstandingIOU: false,
betas: [],
};

function ReportActionItem(props) {
Expand Down Expand Up @@ -326,8 +321,7 @@ function ReportActionItem(props) {
const numberOfThreadReplies = _.get(props, ['action', 'childVisibleActionCount'], 0);
const hasReplies = numberOfThreadReplies > 0;

const shouldDisplayThreadReplies =
hasReplies && props.action.childCommenterCount && Permissions.canUseThreads(props.betas) && !ReportUtils.isThreadFirstChat(props.action, props.report.reportID);
const shouldDisplayThreadReplies = hasReplies && props.action.childCommenterCount && !ReportUtils.isThreadFirstChat(props.action, props.report.reportID);
const oldestFourEmails = lodashGet(props.action, 'childOldestFourEmails', '').split(',');

return (
Expand Down Expand Up @@ -509,9 +503,6 @@ export default compose(
preferredSkinTone: {
key: ONYXKEYS.PREFERRED_EMOJI_SKIN_TONE,
},
betas: {
key: ONYXKEYS.BETAS,
},
}),
)(
memo(
Expand Down

0 comments on commit 145dd4b

Please sign in to comment.