Consistent display of pre-existent filenames and user uploaded filenames

This commit is contained in:
Cássio Zen 2016-06-06 11:04:46 -03:00
parent 6ce5721cd2
commit 3e80bab1f6

View File

@ -77,7 +77,8 @@ export default class ImageControl extends React.Component {
if (this.state.currentImage instanceof File) {
return this.state.currentImage.name;
} else if (typeof this.state.currentImage === 'string') {
return this.state.currentImage;
const fileName = this.state.currentImage;
return fileName.substring(fileName.lastIndexOf('/') + 1);
}
return null;