Unverified Commit 58ffb8e3 authored by Jim Ehrismann's avatar Jim Ehrismann Committed by GitHub
Browse files

ensure old, saved port-forwards get loaded (#4668)

Signed-off-by: default avatarJim Ehrismann <jehrismann@mirantis.com>
parent f7f27a83
master asdasd better-release-script bundled-extensions-update catalog-entity-detail-registry consolidate-running-of-setups-on-application-start dependabot/npm_and_yarn/react-select-5.3.2 dependabot/npm_and_yarn/react-window-1.8.7 dependabot/npm_and_yarn/types/node-14.18.16 dependabot/npm_and_yarn/types/webpack-env-1.16.4 di-stores docs/api-all-exported enhancement-node-vertical-metric-bars entity-settings extension-auto-update extension-dir extensions/lens-version-check feature/auto-update feature/context-providers fix-change-os-theme-crash fix-linter-errors fix-optimise-update-events-from-buffer fix-reload-list-items-on-mount fix-remove-watch-flush-headers fix-reseting-select-value fix-resource-applier fix/consistent-inputs fix/log-store-loading fix/search_input_autofocus front-end-routes-ocp front-end-routes-ocp-2 front-end-routes-ocp-3 helm-repo-manager helm-repo-manager-removal helm-routes issue-1909 issue-3498 issue-3797 issue-4633 issue-4766 issue-4829 issue-4997 issue-5141 issue-5165 issue-5173 issue-5177 issue-5238 more-places-to-check-for-updates prometheus/victoria-metrics-single release/v5.4 remove-unused-telemetry show-extension-preferences-in-separate-page single-logger squashed-update-injectable turn-on-strict ui-table-empty-state-lines update-bundled-extensions update-electon-builder-to-3-0-8 validate-cluster-model websocket-catalog-sync v5.5.0-beta.0 v5.4.6 v5.4.5 v5.4.4 v5.4.3 v5.4.2 v5.4.1 v5.4.0 v5.4.0-beta.5 v5.4.0-beta.4 v5.4.0-beta.3 v5.4.0-beta.2 v5.4.0-beta.1 v5.4.0-beta.0 v5.4.0-alpha.1 v5.4.0-alpha.0
No related merge requests found
Showing with 3 additions and 3 deletions
+3 -3
......@@ -47,14 +47,14 @@ export class PortForwardStore extends ItemStore<PortForwardItem> {
const savedPortForwards = this.storage.get(); // undefined on first load
if (Array.isArray(savedPortForwards)) {
if (Array.isArray(savedPortForwards) && savedPortForwards.length > 0) {
logger.info("[PORT-FORWARD-STORE] starting saved port-forwards");
// add the disabled ones
await Promise.all(savedPortForwards.filter(pf => pf.status === "Disabled").map(addPortForward));
// add the active ones and check if they started successfully
const results = await Promise.allSettled(savedPortForwards.filter(pf => pf.status === "Active").map(addPortForward));
// add the active ones (assume active if the status is undefined, for backward compatibilty) and check if they started successfully
const results = await Promise.allSettled(savedPortForwards.filter(pf => !pf.status || pf.status === "Active").map(addPortForward));
for (const result of results) {
if (result.status === "rejected" || result.value.status === "Disabled") {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment