Change doSave/doSaveAs to resolve the the promise with the FileEntry written. Use that file to close untitled files after close-saving.