Skip to content

Commit

Permalink
actionCollection update event looping when open View Large in Display…
Browse files Browse the repository at this point in the history
… layout #64 #3959 (#3989)
  • Loading branch information
nikhilmandlik committed Jul 1, 2021
1 parent 8422add commit 0256cc4
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/ui/preview/preview-header.vue
Expand Up @@ -103,10 +103,16 @@ export default {
},
mounted() {
if (this.actionCollection) {
this.actionCollection.hide(HIDDEN_ACTIONS);
this.actionCollection.on('update', this.updateActionItems);
this.updateActionItems(this.actionCollection.getActionsObject());
}
},
destroyed() {
if (this.actionCollection) {
this.actionCollection.off('update', this.updateActionItems);
}
},
methods: {
setView(view) {
this.$emit('setView', view);
Expand All @@ -116,7 +122,6 @@ export default {
delete this.actionCollection;
},
updateActionItems() {
this.actionCollection.hide(HIDDEN_ACTIONS);
this.statusBarItems = this.actionCollection.getStatusBarActions();
this.menuActionItems = this.actionCollection.getVisibleActions();
},
Expand Down

0 comments on commit 0256cc4

Please sign in to comment.