mirror of
https://github.com/urosran/cally.git
synced 2025-11-26 08:24:55 +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" />
|
<Ionicons name="person-add-outline" size={24} color="grey" />
|
||||||
</TouchableOpacity>
|
</TouchableOpacity>
|
||||||
<ToDosContextProvider>
|
<ToDosContextProvider>
|
||||||
{choreDialogVisible && <AddChoreDialog
|
{choreDialogVisible &&
|
||||||
isVisible={choreDialogVisible}
|
<AddChoreDialog
|
||||||
setIsVisible={setChoreDialogVisible}
|
isVisible={choreDialogVisible}
|
||||||
selectedTodo={shoppingTodo} /> }
|
setIsVisible={setChoreDialogVisible}
|
||||||
|
selectedTodo={shoppingTodo}
|
||||||
|
isShoppingTodo
|
||||||
|
/>
|
||||||
|
}
|
||||||
</ToDosContextProvider>
|
</ToDosContextProvider>
|
||||||
</View>
|
</View>
|
||||||
</HeaderTemplate>
|
</HeaderTemplate>
|
||||||
|
|||||||
@ -31,6 +31,7 @@ interface IAddChoreDialog {
|
|||||||
isVisible: boolean;
|
isVisible: boolean;
|
||||||
setIsVisible: (value: boolean) => void;
|
setIsVisible: (value: boolean) => void;
|
||||||
selectedTodo?: IToDo;
|
selectedTodo?: IToDo;
|
||||||
|
isShoppingTodo?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
const defaultTodo = {
|
const defaultTodo = {
|
||||||
@ -168,8 +169,7 @@ const AddChoreDialog = (addChoreDialogProps: IAddChoreDialog) => {
|
|||||||
label="Save"
|
label="Save"
|
||||||
onPress={() => {
|
onPress={() => {
|
||||||
try {
|
try {
|
||||||
if (addChoreDialogProps.selectedTodo) {
|
if (addChoreDialogProps.selectedTodo && !addChoreDialogProps.isShoppingTodo) {
|
||||||
|
|
||||||
if (validateTodo()) {
|
if (validateTodo()) {
|
||||||
updateToDo({
|
updateToDo({
|
||||||
...todo,
|
...todo,
|
||||||
|
|||||||
Reference in New Issue
Block a user