Skip to content

Modern Docker Management, Designed for Everyone

fix: environment switcher not showing added or removed items without refresh

Kyle Mendell34c1ddc87dc3
diff --git a/frontend/src/routes/environments/+page.svelte b/frontend/src/routes/environments/+page.svelte
index 744778bf5..756b443f1 100644
--- a/frontend/src/routes/environments/+page.svelte
+++ b/frontend/src/routes/environments/+page.svelte
@@ -9,6 +9,7 @@
import { m } from '$lib/paraglide/messages';
import { environmentManagementService } from '$lib/services/env-mgmt-service';
import { ResourcePageLayout, type ActionButton, type StatCardConfig } from '$lib/layouts/index.js';
+ import { environmentStore } from '$lib/stores/environment.store.svelte';
let { data } = $props();
@@ -68,6 +69,7 @@
const msg = m.common_bulk_remove_success({ count: successCount, resource: m.environments_title() });
toast.success(msg);
await refresh();
+ await environmentStore.initialize(environments.data, true);
}
if (failureCount > 0) {
const msg = m.common_bulk_remove_failed({ count: failureCount, resource: m.environments_title() });
@@ -83,6 +85,7 @@
async function onEnvironmentCreated() {
showEnvironmentSheet = false;
environments = await environmentManagementService.getEnvironments(requestOptions);
+ await environmentStore.initialize(environments.data, true);
toast.success(m.common_create_success({ resource: m.resource_environment() }));
refresh();
}
diff --git a/frontend/src/routes/environments/environment-table.svelte b/frontend/src/routes/environments/environment-table.svelte
index 02f138c1f..f88216e9d 100644
--- a/frontend/src/routes/environments/environment-table.svelte
+++ b/frontend/src/routes/environments/environment-table.svelte
@@ -23,6 +23,7 @@
import CloudIcon from '@lucide/svelte/icons/cloud';
import environmentUpgradeService from '$lib/services/api/environment-upgrade-service';
import UpgradeConfirmationDialog from '$lib/components/dialogs/upgrade-confirmation-dialog.svelte';
+ import { environmentStore } from '$lib/stores/environment.store.svelte';
let {
environments = $bindable(),
@@ -72,6 +73,7 @@
const msg = m.common_bulk_remove_success({ count: successCount, resource: m.environments_title() });
toast.success(msg);
environments = await environmentManagementService.getEnvironments(requestOptions);
+ await environmentStore.initialize(environments.data, true);
}
if (failureCount > 0) {
const msg = m.common_bulk_remove_failed({ count: failureCount, resource: m.environments_title() });
@@ -101,6 +103,7 @@
onSuccess: async () => {
toast.success(m.common_delete_success({ resource: `${m.resource_environment()} "${hostname}"` }));
environments = await environmentManagementService.getEnvironments(requestOptions);
+ await environmentStore.initialize(environments.data, true);
}
});
isLoading.removing = false;