From 23d5623eead4cdc4c17a0505d993c7ceb49293d7 Mon Sep 17 00:00:00 2001 From: Oleksii Orel Date: Tue, 7 Mar 2023 16:22:58 +0200 Subject: [PATCH] fixup! fix: an error when passing the editor's devfile link --- .../src/store/Workspaces/devWorkspaces/index.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts index 94002c9cd..27a5e22e9 100644 --- a/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts +++ b/packages/dashboard-frontend/src/store/Workspaces/devWorkspaces/index.ts @@ -39,7 +39,7 @@ import { AUTHORIZED, SanityCheckAction } from '../../sanityCheckMiddleware'; import * as DwServerConfigStore from '../../ServerConfig'; import { selectOpenVSXUrl } from '../../ServerConfig/selectors'; import { fetchResources } from '../../../services/dashboard-backend-client/devworkspaceResourcesApi'; -import { dump, load } from 'js-yaml'; +import { dump } from 'js-yaml'; import { loadResourcesContent } from '../../../services/registry/resources'; import { checkRunningWorkspacesLimit } from './checkRunningWorkspacesLimit'; import { selectDevWorkspacesResourceVersion } from './selectors'; @@ -551,6 +551,7 @@ export const actionCreators: ActionCreators = { }); if (response.data) { editorContent = response.data; + editorEntry = undefined; } else { throw new Error('Failed to find an Editor in the fetched resources.'); } @@ -559,7 +560,7 @@ export const actionCreators: ActionCreators = { editorContent = undefined; } if (editorEntry !== defaultEditorEntry) { - console.log( + console.debug( `User specified a different editor than the current default. Loading ${editorEntry} definition instead of ${defaultEditorEntry}.`, ); } @@ -569,6 +570,8 @@ export const actionCreators: ActionCreators = { if (!editorContent) { editorEntry = defaultEditorEntry; console.debug(`Using default editor ${defaultEditorEntry}`); + } else { + editorEntry = undefined; } }