Skip to content

Commit

Permalink
Set the editor content as an editor ID for custom editors (#1038)
Browse files Browse the repository at this point in the history
* fix: set the editor content as an editor ID for the custom editors

Signed-off-by: Oleksii Orel <oorel@redhat.com>
  • Loading branch information
olexii4 authored Jan 16, 2024
1 parent 7001436 commit 4d050a2
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,8 @@ export type ActionCreators = {
createWorkspaceFromResources: (
devWorkspace: devfileApi.DevWorkspace,
devWorkspaceTemplate: devfileApi.DevWorkspaceTemplate,
editorId?: string,
// it could be editorId or editorContent
editor?: string,
) => AppThunk<KnownAction, Promise<void>>;

handleWebSocketMessage: (
Expand Down Expand Up @@ -532,15 +533,15 @@ export const actionCreators: ActionCreators = {
(
devWorkspaceResource: devfileApi.DevWorkspace,
devWorkspaceTemplateResource: devfileApi.DevWorkspaceTemplate,
editorId?: string,
editor?: string,
): AppThunk<KnownAction, Promise<void>> =>
async (dispatch, getState): Promise<void> => {
const state = getState();
const defaultKubernetesNamespace = selectDefaultNamespace(state);
const openVSXUrl = selectOpenVSXUrl(state);
const pluginRegistryUrl = selectPluginRegistryUrl(state);
const pluginRegistryInternalUrl = selectPluginRegistryInternalUrl(state);
const cheEditor = editorId ? editorId : selectDefaultEditor(state);
const cheEditor = editor ? editor : selectDefaultEditor(state);
const defaultNamespace = defaultKubernetesNamespace.name;

try {
Expand Down Expand Up @@ -912,7 +913,7 @@ export const actionCreators: ActionCreators = {
actionCreators.createWorkspaceFromResources(
devWorkspaceResource,
devWorkspaceTemplateResource,
editor,
editor ? editor : editorContent,
),
);
},
Expand Down

0 comments on commit 4d050a2

Please sign in to comment.