Skip to content

Commit

Permalink
[FIX][APPS] Action buttons not removed when app is disabled or uninst…
Browse files Browse the repository at this point in the history
…alled (#24107)
  • Loading branch information
d-gubert authored Jan 5, 2022
1 parent fc9c193 commit bf6878e
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/apps/client/communication/websockets.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export class AppWebsocketReceiver extends Emitter {
this.streamer.on(AppEvents.COMMAND_UPDATED, this.onCommandAddedOrUpdated);
this.streamer.on(AppEvents.COMMAND_REMOVED, this.onCommandRemovedOrDisabled);
this.streamer.on(AppEvents.COMMAND_DISABLED, this.onCommandRemovedOrDisabled);
this.streamer.on(AppEvents.COMMAND_DISABLED, this.onActionsChanged);
this.streamer.on(AppEvents.ACTIONS_CHANGED, this.onActionsChanged);
}

registerListener(event, listener) {
Expand Down
4 changes: 4 additions & 0 deletions app/ui-utils/client/lib/MessageAction.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ export const MessageAction = new (class {
return Tracker.nonreactive(() => {
const btns = this.buttons.get();
delete btns[id];
mem.clear(this._getButtons);
mem.clear(this._getButtonsByGroup);
return this.buttons.set(btns);
});
}
Expand All @@ -79,6 +81,8 @@ export const MessageAction = new (class {
const btns = this.buttons.get();
if (btns[id]) {
btns[id] = _.extend(btns[id], config);
mem.clear(this._getButtons);
mem.clear(this._getButtonsByGroup);
return this.buttons.set(btns);
}
});
Expand Down
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
"@nivo/heatmap": "0.73.0",
"@nivo/line": "0.62.0",
"@nivo/pie": "0.73.0",
"@rocket.chat/apps-engine": "^1.29.0",
"@rocket.chat/apps-engine": "^1.29.1",
"@rocket.chat/css-in-js": "^0.31.0",
"@rocket.chat/emitter": "^0.31.0",
"@rocket.chat/fuselage": "^0.31.0",
Expand Down

0 comments on commit bf6878e

Please sign in to comment.