Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove modal when navigating back #5165

Open
wants to merge 17 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/components/CreateGroupDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ export default {
mounted() {
this.modal = new Modal(this.$refs.modal);
},
beforeUnmount() {
this.cleanupModal();
},
methods: {
/**
* Show the confirm dialog
Expand All @@ -58,6 +61,19 @@ export default {
this.$emit("added", this.groupName);
this.modal.hide();
},
/**
* Clean up modal and restore scroll behavior
* @returns {void}
*/
cleanupModal() {
if (this.modal) {
try {
this.modal.hide();
} catch (e) {
console.warn("Modal hide failed:", e);
}
}
}
},
};
</script>
17 changes: 17 additions & 0 deletions src/components/NotificationDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,9 @@ export default {
mounted() {
this.modal = new Modal(this.$refs.modal);
},
beforeUnmount() {
this.cleanupModal();
},
methods: {

/**
Expand Down Expand Up @@ -336,6 +339,20 @@ export default {
});
} while (this.$root.notificationList.find(it => it.name === name));
return name;
},

/**
* Clean up modal and restore scroll behavior
* @returns {void}
*/
cleanupModal() {
if (this.modal) {
try {
this.modal.hide();
} catch (e) {
console.warn("Modal hide failed:", e);
}
}
}
},
};
Expand Down
19 changes: 17 additions & 2 deletions src/components/ProxyDialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,12 @@ export default {
}
};
},

mounted() {
this.modal = new Modal(this.$refs.modal);
},

beforeUnmount() {
this.cleanupModal();
},
methods: {
/**
* Show dialog to confirm deletion
Expand Down Expand Up @@ -209,6 +210,20 @@ export default {
}
});
},

/**
* Clean up modal and restore scroll behavior
* @returns {void}
*/
cleanupModal() {
if (this.modal) {
try {
this.modal.hide();
} catch (e) {
console.warn("Modal hide failed:", e);
}
}
}
},
};
</script>
Expand Down
16 changes: 16 additions & 0 deletions src/components/TagsManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,9 @@ export default {
this.modal = new Modal(this.$refs.modal);
this.getExistingTags();
},
beforeUnmount() {
this.cleanupModal();
},
methods: {
/**
* Show the add tag dialog
Expand Down Expand Up @@ -459,6 +462,19 @@ export default {
this.newTags = [];
this.deleteTags = [];
this.processing = false;
},
/**
* Clean up modal and restore scroll behavior
* @returns {void}
*/
cleanupModal() {
if (this.modal) {
try {
this.modal.hide();
} catch (e) {
console.warn("Modal hide failed:", e);
}
}
}
},
};
Expand Down
Loading