Skip to content

Commit

Permalink
[fix] reoves duplicate Image kind when resetting data
Browse files Browse the repository at this point in the history
- merge error
  • Loading branch information
Andrea-Papaleo committed Jul 23, 2024
1 parent 2d36ceb commit 9c6eb46
Showing 1 changed file with 1 addition and 16 deletions.
17 changes: 1 addition & 16 deletions src/store/data/dataSlice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,22 +72,7 @@ export const dataSlice = createSlice({
initialState: initialState,
reducers: {
resetData: (state) => {
const newState = initialState();
const newUnknownCategory = generateUnknownCategory("Image");
const imageKind = {
id: "Image",
categories: [newUnknownCategory.id],
containing: [],
unknownCategoryId: newUnknownCategory.id,
} as Kind;
newState.kinds.ids.push(imageKind.id);
newState.kinds.entities[imageKind.id] = { saved: imageKind, changes: {} };
newState.categories.ids.push(newUnknownCategory.id);
newState.categories.entities[newUnknownCategory.id] = {
saved: newUnknownCategory,
changes: {},
};
return newState;
return initialState();
},
initializeState(
state,
Expand Down

0 comments on commit 9c6eb46

Please sign in to comment.