From 56d16308884c21ff11e207b95b898f21c962fe4f Mon Sep 17 00:00:00 2001 From: Matilde Park Date: Wed, 4 Mar 2020 19:45:02 -0500 Subject: [PATCH] chat: reducer handles metadata removal --- pkg/interface/chat/src/js/reducers/metadata-update.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg/interface/chat/src/js/reducers/metadata-update.js b/pkg/interface/chat/src/js/reducers/metadata-update.js index 331f3bac3f..84e8c3246b 100644 --- a/pkg/interface/chat/src/js/reducers/metadata-update.js +++ b/pkg/interface/chat/src/js/reducers/metadata-update.js @@ -7,6 +7,7 @@ export class MetadataReducer { this.associations(data, state); this.add(data, state); this.update(data, state); + this.remove(data, state); } } @@ -39,4 +40,13 @@ export class MetadataReducer { 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; + } + } } \ No newline at end of file