Selects custom color when created

This commit is contained in:
Josh Perez
2021-06-03 17:34:36 -04:00
committed by GitHub
parent 6d82acd23c
commit 53d6065c00
8 changed files with 158 additions and 79 deletions

View File

@@ -141,7 +141,8 @@ function getDefaultCustomColorData() {
}
function addCustomColor(
payload: CustomColorType
customColor: CustomColorType,
nextAction: (uuid: string) => unknown
): ThunkAction<void, RootStateType, unknown, ItemPutAction> {
return (dispatch, getState) => {
const { customColors = getDefaultCustomColorData() } = getState().items;
@@ -155,11 +156,12 @@ function addCustomColor(
...customColors,
colors: {
...customColors.colors,
[uuid]: payload,
[uuid]: customColor,
},
};
dispatch(putItem('customColors', nextCustomColors));
nextAction(uuid);
};
}