mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-02 11:15:35 +03:00
used created grooming utils function
This commit is contained in:
parent
95d8816536
commit
62e68a5998
@ -78,9 +78,9 @@ class SettingsScreen extends PureComponent {
|
|||||||
})}
|
})}
|
||||||
type="dropdown"
|
type="dropdown"
|
||||||
actionType="api"
|
actionType="api"
|
||||||
options={serverList.map(server => server)}
|
options={serverList.map(serverName => groomingServerName(serverName))}
|
||||||
selectedOptionIndex={serverList.indexOf(selectedApi)}
|
selectedOptionIndex={serverList.indexOf(selectedApi)}
|
||||||
defaultText={selectedApi}
|
defaultText={groomingServerName(selectedApi)}
|
||||||
handleOnChange={handleOnChange}
|
handleOnChange={handleOnChange}
|
||||||
/>
|
/>
|
||||||
<SettingsItem
|
<SettingsItem
|
||||||
|
@ -4,11 +4,11 @@ export const groomingServerName = (serverName) => {
|
|||||||
|
|
||||||
if (!serverName) return null;
|
if (!serverName) return null;
|
||||||
|
|
||||||
if (serverName.indefOf(PREFIX1) === 0) {
|
if (serverName.indexOf(PREFIX1) === 0) {
|
||||||
return serverName.str.substr(PREFIX1.length);
|
return serverName.substr(PREFIX1.length);
|
||||||
}
|
}
|
||||||
if (serverName.indefOf(PREFIX2) === 0) {
|
if (serverName.indexOf(PREFIX2) === 0) {
|
||||||
return serverName.str.substr(PREFIX2.length);
|
return serverName.substr(PREFIX2.length);
|
||||||
}
|
}
|
||||||
return serverName;
|
return serverName;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user