Updated: Adjust monitor deletion flow and page reload behavior

- Changed the page redirect after monitor deletion to the home page ("/") for a proper UI refresh.
- Removed the temporary route ("/temp") to simplify the deletion process.
- Ensured that the UI reloads correctly after monitor deletions via a direct redirect to the home page.

modified: src/components/MonitorList.vue
This commit is contained in:
GJS 2025-01-02 14:08:13 +01:00
parent 6a96694c17
commit c4391bb583
No known key found for this signature in database
GPG key ID: BE32D9EAF927E85B

View file

@ -354,11 +354,9 @@ export default {
// Remove the monitor from the selectedMonitors list upon successful deletion // Remove the monitor from the selectedMonitors list upon successful deletion
delete this.selectedMonitors[id]; delete this.selectedMonitors[id];
// Use Vue Router to navigate to a temporary route before redirecting to /dashboard // Navigate to the home page ("/") to trigger a page reload and reflect the updates
// This reloads the page to reflect changes after deletion // This step is necessary to refresh the UI after the monitors have been deleted
this.$router.push("/temp").then(() => { this.$router.push("/");
this.$router.push("/dashboard");
});
// Store a flag in localStorage to trigger a toast notification on page reload // Store a flag in localStorage to trigger a toast notification on page reload
// This ensures the notification displays after the page refreshes // This ensures the notification displays after the page refreshes