Skip to content

Commit

Permalink
fix activeModCompnent deselection during save
Browse files Browse the repository at this point in the history
  • Loading branch information
grahamlangford committed Nov 12, 2024
1 parent 0b5c188 commit b12c321
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,16 +348,22 @@ export const editorSlice = createSlice({
///

/**
* Activate the mod with the given id. Expands the mod listing pane item if not already expanded
* Select the mod with the given id. Expands the mod listing pane item if not already expanded
* @see toggleExpandedModId
*/
setActiveModId(state, action: PayloadAction<RegistryId>) {
const modId = action.payload;
const activeModComponent = selectActiveModComponentFormState({
editor: state,
});

state.error = null;
state.activeModComponentId = null;
state.activeModId = modId;

if (activeModComponent?.modMetadata.id !== modId) {
state.activeModComponentId = null;
}

if (state.expandedModId !== modId) {
state.expandedModId = modId;
}
Expand Down

0 comments on commit b12c321

Please sign in to comment.