Skip to content

Commit

Permalink
Merge pull request #10728 from Expensify/justice-default-workspace-name
Browse files Browse the repository at this point in the history
[NO QA]Remove misplaced method
  • Loading branch information
srikarparsi authored Sep 1, 2022
2 parents 052c177 + 2283ae1 commit 0862c17
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions src/libs/actions/Policy.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import _ from 'underscore';
import Onyx from 'react-native-onyx';
import lodashGet from 'lodash/get';
import {PUBLIC_DOMAINS} from 'expensify-common/lib/CONST';
import Str from 'expensify-common/lib/str';
import * as DeprecatedAPI from '../deprecatedAPI';
import * as API from '../API';
import ONYXKEYS from '../../ONYXKEYS';
Expand Down Expand Up @@ -752,14 +753,6 @@ function clearAddMemberError(policyID, memberEmail) {
});
}

/**
* @param {String} value
* @returns {String}
*/
function capitalizeFirstLetter(value) {
return value.charAt(0).toUpperCase() + value.slice(1);
}

/**
* Generate a policy name based on an email and policy list.
* @returns {String}
Expand All @@ -774,9 +767,9 @@ function generateDefaultWorkspaceName() {
const domain = emailParts[1];

if (_.includes(PUBLIC_DOMAINS, domain.toLowerCase())) {
defaultWorkspaceName = `${capitalizeFirstLetter(username)}'s Workspace`;
defaultWorkspaceName = `${Str.UCFirst(username)}'s Workspace`;
} else {
defaultWorkspaceName = `${capitalizeFirstLetter(domain.split('.')[0])}'s Workspace`;
defaultWorkspaceName = `${Str.UCFirst(domain.split('.')[0])}'s Workspace`;
}

if (`@${domain.toLowerCase()}` === CONST.SMS.DOMAIN) {
Expand Down

0 comments on commit 0862c17

Please sign in to comment.