[redesign] moar fixes #1236

Merged
neb-b merged 7 commits from redesign-fixes into master 2018-04-04 01:07:49 +02:00
Showing only changes of commit 31991a2ed1 - Show all commits

View file

@ -140,13 +140,20 @@ class PublishForm extends React.PureComponent<Props> {
} }
handleFileChange(filePath: string, fileName: string) { handleFileChange(filePath: string, fileName: string) {
const { updatePublishForm, channel } = this.props; const { updatePublishForm, channel, name } = this.props;
const parsedFileName = fileName.replace(regexInvalidURI, ''); const newFileParams: {
const uri = this.getNewUri(parsedFileName, channel); filePath: string,
name?: string,
uri?: string
} = { filePath };
if (filePath) { if (!name) {
updatePublishForm({ filePath, name: parsedFileName, uri }); const parsedFileName = fileName.replace(regexInvalidURI, '');
const uri = this.getNewUri(parsedFileName, channel);
newFileParams.name = parsedFileName;
} }
updatePublishForm(newFileParams);
} }
handleNameChange(name: ?string) { handleNameChange(name: ?string) {