Skip to content
Snippets Groups Projects
Commit 2eb2bbd8 authored by Oswaldo Acauan's avatar Oswaldo Acauan
Browse files

Fix case when there is no current selected

parent df23e6bb
No related branches found
No related tags found
No related merge requests found
......@@ -129,6 +129,10 @@ const persistPresentationChanges = (oldState, newState, uploadEndpoint) => {
return Promise.resolve(presentations);
})
.then((presentations) => {
if (currentPresentation === undefined) {
return Promise.resolve();
}
// If its a newly uploaded presentation we need to get it from promise result
if (!currentPresentation.conversion.done) {
const currentIndex = presentationsToUpload.findIndex(p => p === currentPresentation);
......@@ -136,7 +140,7 @@ const persistPresentationChanges = (oldState, newState, uploadEndpoint) => {
}
// skip setting as current if error happened
if (currentPresentation === undefined || currentPresentation.conversion.error) {
if (currentPresentation.conversion.error) {
return Promise.resolve();
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment