haystack / listit

The listit lightweight notetaking client
http://listit.csail.mit.edu/
MIT License
9 stars 6 forks source link

trash bin version BETA #217

Closed xiangcy closed 8 years ago

xiangcy commented 10 years ago

BETA version for Chrome version trash bin. People can restore their deleted notes. A current problem is that when a user restore a note, the note will show up in the sidebar immediately; however, when a user delete a note, the note will not show up on the trashbin page. Steven, do you know how to fix it?

Stebalien commented 10 years ago

You need to listen on events emitted by the deletedNotes collection. That is, you'll need to add something like the following to the TrashPageView:

this.listenTo(this.collection, "add", function(model, collection) {
  // Display the note.
});
this.listenTo(this.collection, "remove", function(model, collection) {
  // Remove the note's view.
});
xiangcy commented 10 years ago

Trashbin working on webapp and Firefox. Still need to mitigate issues synchronizing with servers.

xiangcy commented 10 years ago

Currently the implementation does not consider race condition. So a destroy will overwrite all updates on another session.

xiangcy commented 10 years ago

Code fixes and also race condition implementation so that future updates overwrite the destroy.

xiangcy commented 10 years ago

fix the problem above