Skip to content

Commit

Permalink
address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rezkiy37 committed Apr 15, 2024
1 parent d07e04a commit 7321ad2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions src/libs/ReportActionsUtils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ function isInviteMemberAction(reportAction: OnyxEntry<ReportAction>) {
return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.ROOMCHANGELOG.INVITE_TO_ROOM || reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG.INVITE_TO_ROOM;
}

function isLeaveMemberAction(reportAction: OnyxEntry<ReportAction>) {
function isLeavePolicyAction(reportAction: OnyxEntry<ReportAction>) {
return reportAction?.actionName === CONST.REPORT.ACTIONS.TYPE.POLICYCHANGELOG.LEAVE_POLICY;
}

Expand Down Expand Up @@ -866,11 +866,10 @@ function isNotifiableReportAction(reportAction: OnyxEntry<ReportAction>): boolea

function getMemberChangeMessageElements(reportAction: OnyxEntry<ReportAction>): readonly MemberChangeMessageElement[] {
const isInviteAction = isInviteMemberAction(reportAction);
const isLeaveAction = isLeaveMemberAction(reportAction);
const isLeaveAction = isLeavePolicyAction(reportAction);

// Currently, we only render messages when members are invited
let verb = Localize.translateLocal('workspace.invite.removed');

if (isInviteAction) {
verb = Localize.translateLocal('workspace.invite.invited');
}
Expand Down
1 change: 0 additions & 1 deletion src/libs/actions/Policy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -976,7 +976,6 @@ function removeMembers(accountIDs: number[], policyID: string) {
API.write(WRITE_COMMANDS.DELETE_MEMBERS_FROM_WORKSPACE, params, {optimisticData, successData, failureData});
}

/** Leave a workspace */
function leaveWorkspace(policyID: string) {
const membersListKey = `${ONYXKEYS.COLLECTION.POLICY_MEMBERS}${policyID}` as const;
const policy = allPolicies?.[`${ONYXKEYS.COLLECTION.POLICY}${policyID}`];
Expand Down

0 comments on commit 7321ad2

Please sign in to comment.