From 3e80bab1f6f76f327c32cc70288ce7e3286a0f09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A1ssio=20Zen?= Date: Mon, 6 Jun 2016 11:04:46 -0300 Subject: [PATCH] Consistent display of pre-existent filenames and user uploaded filenames --- src/components/Widgets/ImageControl.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Widgets/ImageControl.js b/src/components/Widgets/ImageControl.js index cc428562..68d9c884 100644 --- a/src/components/Widgets/ImageControl.js +++ b/src/components/Widgets/ImageControl.js @@ -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;