used created grooming utils function

This commit is contained in:
u-e 2019-01-16 11:25:53 +03:00
parent 95d8816536
commit 62e68a5998
2 changed files with 6 additions and 6 deletions

View File

@ -78,9 +78,9 @@ class SettingsScreen extends PureComponent {
})}
type="dropdown"
actionType="api"
options={serverList.map(server => server)}
options={serverList.map(serverName => groomingServerName(serverName))}
selectedOptionIndex={serverList.indexOf(selectedApi)}
defaultText={selectedApi}
defaultText={groomingServerName(selectedApi)}
handleOnChange={handleOnChange}
/>
<SettingsItem

View File

@ -4,11 +4,11 @@ export const groomingServerName = (serverName) => {
if (!serverName) return null;
if (serverName.indefOf(PREFIX1) === 0) {
return serverName.str.substr(PREFIX1.length);
if (serverName.indexOf(PREFIX1) === 0) {
return serverName.substr(PREFIX1.length);
}
if (serverName.indefOf(PREFIX2) === 0) {
return serverName.str.substr(PREFIX2.length);
if (serverName.indexOf(PREFIX2) === 0) {
return serverName.substr(PREFIX2.length);
}
return serverName;
};