Skip to content

Commit 8f45f0a

Browse files
committed
fix bug where rewriting the directive was deferred and not updated before download
1 parent 74d22da commit 8f45f0a

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/plugins/handlers.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,15 @@ function handlers(app, opts, done){
620620
const post = content.substring(end, content.length);
621621
const newSource = pre + name + post;
622622

623-
documents.update(newSource);
624-
workspace.updateContent(newSource);
623+
workspace.updateContent(newSource)
624+
.then(function(){
625+
documents.update(newSource);
626+
store.dispatch(creators.updateSelectedDevice(device));
627+
download();
628+
});
629+
// workspace.updateContent is a promise returning function
630+
// so we handle the other stuff in a .then and return here
631+
return;
625632
}
626633

627634
store.dispatch(creators.updateSelectedDevice(device));

0 commit comments

Comments
 (0)