From e4c6fa052ae66d278cfd612606978956d24a6fca Mon Sep 17 00:00:00 2001 From: Dan Helfman Date: Fri, 18 Jan 2008 21:29:11 +0000 Subject: [PATCH] * bug: occasionally, undeleted notes don't leave the trash (but change to having non-trash buttons when undeleted). repro: 1. delete a note 2. go to the trash 3. click undelete, and then *very quickly*, click the name of the notebook 4. when the notebook loads, it won't have the undeleted note 5. go back to the trash. the deleted note will be there, with non-trash note buttons this seems to be a race between undelete_editor_via_trash() and save_editor(), which is invoked upon page close. solution: don't allow save_editor() to call save_note() if editor.closed is set --- static/js/Wiki.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/static/js/Wiki.js b/static/js/Wiki.js index 88f4509..8480446 100644 --- a/static/js/Wiki.js +++ b/static/js/Wiki.js @@ -1132,7 +1132,7 @@ Wiki.prototype.save_editor = function ( editor, fire_and_forget ) { editor = this.focused_editor; var self = this; - if ( editor && editor.read_write && !( editor.id == this.blank_editor_id && editor.empty() ) ) { + if ( editor && editor.read_write && !( editor.id == this.blank_editor_id && editor.empty() ) && !editor.closed ) { this.invoker.invoke( "/notebooks/save_note", "POST", { "notebook_id": this.notebook_id, "note_id": editor.id,