mirror of
https://github.com/urosran/cally.git
synced 2025-11-26 00:24:53 +00:00
- Fixed issue with improper creation of Shopping todo
This commit is contained in:
@ -145,10 +145,14 @@ const GroceryList = ({onInputFocus}: {onInputFocus: (y: number) => void}) => {
|
||||
<Ionicons name="person-add-outline" size={24} color="grey" />
|
||||
</TouchableOpacity>
|
||||
<ToDosContextProvider>
|
||||
{choreDialogVisible && <AddChoreDialog
|
||||
{choreDialogVisible &&
|
||||
<AddChoreDialog
|
||||
isVisible={choreDialogVisible}
|
||||
setIsVisible={setChoreDialogVisible}
|
||||
selectedTodo={shoppingTodo} /> }
|
||||
selectedTodo={shoppingTodo}
|
||||
isShoppingTodo
|
||||
/>
|
||||
}
|
||||
</ToDosContextProvider>
|
||||
</View>
|
||||
</HeaderTemplate>
|
||||
|
||||
@ -31,6 +31,7 @@ interface IAddChoreDialog {
|
||||
isVisible: boolean;
|
||||
setIsVisible: (value: boolean) => void;
|
||||
selectedTodo?: IToDo;
|
||||
isShoppingTodo?: boolean;
|
||||
}
|
||||
|
||||
const defaultTodo = {
|
||||
@ -168,8 +169,7 @@ const AddChoreDialog = (addChoreDialogProps: IAddChoreDialog) => {
|
||||
label="Save"
|
||||
onPress={() => {
|
||||
try {
|
||||
if (addChoreDialogProps.selectedTodo) {
|
||||
|
||||
if (addChoreDialogProps.selectedTodo && !addChoreDialogProps.isShoppingTodo) {
|
||||
if (validateTodo()) {
|
||||
updateToDo({
|
||||
...todo,
|
||||
|
||||
Reference in New Issue
Block a user