Skip to content

Commit

Permalink
quick fix for #586. A more durable solution is inbound
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuafcole committed Dec 2, 2016
1 parent 1b0db0e commit a933364
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/ide.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2130,6 +2130,14 @@ export class IDE {

let md = this.editor.toMarkdown();

// @NOTE: We sync this here to prevent a terrible reload bug that occurs when saving to the file system.
// This isn't really the right fix, but it's a quick one that helps prevent lost work in trivial cases
// like navigating the workspace.
// @TODO: This logic needs ripped out entirely and replaced with a saner abstraction that keeps the
// file system and workspace in sync.
// @TODO: localStorage also needs to get synced and cleared lest it permanently overrule other sources of truth.
this._fileCache[this.documentId] = md;

// if we're not local, we notify the outside world that we're trying
// to save
if(!this.local) {
Expand Down

0 comments on commit a933364

Please sign in to comment.