I have a region in my Marionette project called the "primary" region for which I show a loading view and then a download view once the loading (decrypting) is finished. Here's what I have it doing right now:
var loadingView = new fileView.Loading();
appManager.regions.primary.show(loadingView);
//Promise waiting for file to decrypt before
//switching views
decryptFile(file).then(function (decryptedFile) {
var downloadView = new fileView.Download({
model: decryptedFile
});
appManager.regions.primary.show(downloadView);
})
As of now, when the decrypt function is finished, my primary region goes blank instead of showing my downloadView. I've made sure downloadView exists and works fine by logging it to the console so that's not the problem. Any ideas why it isn't showing up?
Edit: Also, my downloadView does render just fine when I pull the code outside of the promise.