[redesign] moar fixes #1236
1 changed files with 12 additions and 5 deletions
|
@ -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) {
|
||||||
|
|
Loading…
Reference in a new issue