Skip to content

Commit

Permalink
Ignore same revision changes
Browse files Browse the repository at this point in the history
Possible solution for #188

Will look for a better solution
  • Loading branch information
jlami authored Jul 27, 2017
1 parent 30c4928 commit 7210873
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion addon/adapters/pouch.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,11 @@ export default DS.RESTAdapter.extend({
this.unloadedDocumentChanged(obj);
return;
}
if (!recordInStore.get('isLoaded') || recordInStore.get('hasDirtyAttributes')) {
if (!recordInStore.get('isLoaded') || recordInStore.get('rev') === change.changes[0].rev || recordInStore.get('hasDirtyAttributes')) {
// The record either hasn't loaded yet or has unpersisted local changes.
// In either case, we don't want to refresh it in the store
// (and for some substates, attempting to do so will result in an error).
// We also ignore the change if we already have the latest revision
return;
}

Expand Down

0 comments on commit 7210873

Please sign in to comment.