handle local deletion relationships
This commit is contained in:
@@ -107,6 +107,10 @@ class Item {
|
||||
// must override
|
||||
}
|
||||
|
||||
isBeingRemovedLocally() {
|
||||
|
||||
}
|
||||
|
||||
removeAllRelationships() {
|
||||
// must override
|
||||
this.setDirty(true);
|
||||
|
||||
@@ -56,6 +56,13 @@ class Note extends Item {
|
||||
this.tags = [];
|
||||
}
|
||||
|
||||
isBeingRemovedLocally() {
|
||||
this.tags.forEach(function(tag){
|
||||
_.pull(tag.notes, this);
|
||||
}.bind(this))
|
||||
super.isBeingRemovedLocally();
|
||||
}
|
||||
|
||||
static filterDummyNotes(notes) {
|
||||
var filtered = notes.filter(function(note){return note.dummy == false || note.dummy == null});
|
||||
return filtered;
|
||||
|
||||
@@ -55,6 +55,13 @@ class Tag extends Item {
|
||||
this.notes = [];
|
||||
}
|
||||
|
||||
isBeingRemovedLocally() {
|
||||
this.notes.forEach(function(note){
|
||||
_.pull(note.tags, this);
|
||||
}.bind(this))
|
||||
super.isBeingRemovedLocally();
|
||||
}
|
||||
|
||||
get content_type() {
|
||||
return "Tag";
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user