Skip to content

Commit

Permalink
fix: Delete events listening on Vue application unmount - MEED-6224 - M…
Browse files Browse the repository at this point in the history
…eeds-io/MIPs#120

Before this change, some errors are logged in Layout management UI when adding and removing the News List application multiple times. This change ensures to delete listeners on unmount and to make sure that the settings drawer is displayed even in a sticky container.
  • Loading branch information
boubaker authored and rdenarie committed Apr 26, 2024
1 parent a7e5ebc commit 397a81b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Expand Up @@ -205,9 +205,9 @@ export default {
this.retrieveNewsList().finally(() => this.$root.$applicationLoaded());
document.addEventListener(`component-${this.extensionApp}-${this.extensionType}-updated`, this.refreshViewExtensions);
this.refreshViewExtensions();
document.addEventListener('drawerOpened', () => this.$el.closest('#stickyBlockDesktop').style.position = 'static');
document.addEventListener('drawerClosed', () => this.$el.closest('#stickyBlockDesktop').style.position = 'sticky');
},
beforeDestroy() {
document.removeEventListener(`component-${this.extensionApp}-${this.extensionType}-updated`, this.refreshViewExtensions);
},
methods: {
retrieveNewsList() {
Expand Down
Expand Up @@ -21,6 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
id="newsSettingsDrawer"
right
fixed
detached
@closed="close">
<template slot="title">
<div class="flex flex-row">
Expand Down

0 comments on commit 397a81b

Please sign in to comment.