moving string size check to helper lib

This commit is contained in:
Cássio Zen
2016-06-07 21:33:12 -03:00
parent 327cb883ee
commit 2d48743f37
2 changed files with 5 additions and 6 deletions

View File

@ -72,11 +72,7 @@ export default class ImageControl extends React.Component {
renderImageName() {
if (!this.state.currentImage) return null;
const { uri } = this.state.currentImage;
if (uri.length <= MAX_DISPLAY_LENGTH) {
return uri;
}
return truncateMiddle(uri, MAX_DISPLAY_LENGTH);
return truncateMiddle(this.state.currentImage.uri, MAX_DISPLAY_LENGTH);
}
render() {