mirror of
https://github.com/urbit/shrub.git
synced 2024-12-12 10:29:01 +03:00
chat: reducer handles metadata removal
This commit is contained in:
parent
ab793f1f70
commit
56d1630888
@ -7,6 +7,7 @@ export class MetadataReducer {
|
|||||||
this.associations(data, state);
|
this.associations(data, state);
|
||||||
this.add(data, state);
|
this.add(data, state);
|
||||||
this.update(data, state);
|
this.update(data, state);
|
||||||
|
this.remove(data, state);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -39,4 +40,13 @@ export class MetadataReducer {
|
|||||||
state.associations = metadata;
|
state.associations = metadata;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
remove(json, state) {
|
||||||
|
let data = _.get(json, 'remove', false);
|
||||||
|
if (data) {
|
||||||
|
let metadata = state.associations;
|
||||||
|
metadata.delete(data["app-path"]);
|
||||||
|
state.associations = metadata;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user