Skip to content

Commit

Permalink
fixed minor bug where edit space dialog did not auto populate the spa…
Browse files Browse the repository at this point in the history
…ce name field when going thru the 'Make Space from Group' workflow
  • Loading branch information
Patrick Bergeron committed Aug 3, 2023
1 parent 2b69eaa commit 2b9abc2
Showing 1 changed file with 15 additions and 9 deletions.
24 changes: 15 additions & 9 deletions app/src/renderer/apps/Spaces/Workflow/EditSpace/EditSpace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,24 @@ const EditSpacePresenter = ({ edit, workflowState, setState }: Props) => {

const existingSpace = spacesStore.spaces.get(edit?.space);

const initialValues: SpaceWorkFlowState = {
let initialValues: SpaceWorkFlowState = {
...workflowState,
path: existingSpace?.path,
name: existingSpace?.name || '',
description: existingSpace?.description || '',
color: existingSpace?.color || '#000000',
picture: existingSpace?.picture || '',
access: (existingSpace?.access as AccessOptionType) || 'public',
crestOption: existingSpace?.picture ? 'image' : 'color',
theme: toJS(existingSpace?.theme),
};

if (existingSpace) {
initialValues = {
...initialValues,
path: existingSpace?.path,
name: existingSpace?.name || '',
description: existingSpace?.description || '',
color: existingSpace?.color || '#000000',
picture: existingSpace?.picture || '',
access: (existingSpace?.access as AccessOptionType) || 'public',
crestOption: existingSpace?.picture ? 'image' : 'color',
theme: toJS(existingSpace?.theme),
};
}

const updateState = (state: Partial<SpaceWorkFlowState>) => {
setState?.({ ...workflowState, ...state });
};
Expand Down

0 comments on commit 2b9abc2

Please sign in to comment.