fix(session): reset the environment session storage after deleting it (#8119)

pull/8182/head
Oscar Zhou 2 years ago committed by GitHub
parent 563ead85cc
commit 1008afd1fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -33,6 +33,13 @@ export function EndpointProvider() {
if (endpoint && endpoint.Type === EnvironmentType.EdgeAgentOnDocker) { if (endpoint && endpoint.Type === EnvironmentType.EdgeAgentOnDocker) {
state.pingInterval = setInterval(() => ping(endpoint.Id), 60 * 1000); state.pingInterval = setInterval(() => ping(endpoint.Id), 60 * 1000);
} }
if (endpoint === null) {
sessionStorage.setItem(
'portainer.environmentId',
JSON.stringify(undefined)
);
}
} }
function currentEndpoint() { function currentEndpoint() {

@ -46,8 +46,6 @@ export class EndpointsController {
// If the current endpoint was deleted, then clean endpoint store // If the current endpoint was deleted, then clean endpoint store
if (endpoints.some((e) => e.Id === id)) { if (endpoints.some((e) => e.Id === id)) {
this.StateManager.cleanEndpoint(); this.StateManager.cleanEndpoint();
// trigger sidebar rerender
this.applicationState.endpoint = {};
} }
this.$state.reload(); this.$state.reload();

Loading…
Cancel
Save