Web: Client: Opening the file immediately after creation

This commit is contained in:
Alexey Kostenko 2020-09-21 11:06:53 +03:00
parent 916eb0439c
commit 4e1415774d
2 changed files with 6 additions and 2 deletions

View File

@ -113,7 +113,10 @@ class FilesRowContent extends React.PureComponent {
? createFolder(item.parentId, itemTitle)
.then(() => this.completeAction(e)).finally(() => setIsLoading(false))
: createFile(item.parentId, `${itemTitle}.${item.fileExst}`)
.then(() => this.completeAction(e)).finally(() => setIsLoading(false))
.then((file) => {
window.open(file.webUrl, "_blank")
this.completeAction(e)
}).finally(() => setIsLoading(false))
}
componentDidUpdate(prevProps) {

View File

@ -375,8 +375,9 @@ export function fetchTreeFolders(dispatch) {
export function createFile(folderId, title) {
return dispatch => {
return files.createFile(folderId, title)
.then(folder => {
.then(file => {
fetchFolder(folderId, dispatch);
return Promise.resolve(file)
});
};
}