Skip to content

Commit

Permalink
Merge pull request #23 from jaydenchee97/fix-location-selection
Browse files Browse the repository at this point in the history
fix : location selection check
  • Loading branch information
Nova136 authored Aug 12, 2024
2 parents 69e8f56 + ab3fcaa commit 5a2914f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/screens/HostingStep1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ export default function HostingStep1({ navigation, route }) {
const updateAddress = useHostStore((state) => state.updateAddress);

const onNavigate = () => {
if (!propertyType) {
alert("Please select a property type before proceeding.");
return;
}

// update zustand store
updatePropertyType(propertyType);
// updateMaxGuest(guest);
Expand Down Expand Up @@ -172,7 +177,7 @@ export default function HostingStep1({ navigation, route }) {
<PaperButton
mode="contained"
onPress={() => onNavigate()}
style={undefined}
disabled={!propertyType} // Disable button if no property type is selected
>
Next
</PaperButton>
Expand Down
6 changes: 6 additions & 0 deletions src/screens/HostingStep4.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,12 @@ export default function HostingStep4({ navigation }) {
// },
// ]);
// }

const propertyType = EPropertyType[hostStore.propertyType];
if (!propertyType) {
console.error("Invalid property type:", hostStore.propertyType);
return; // Handle the error accordingly
}

// change to graphql
console.log("Creating new accommodation");
Expand Down

0 comments on commit 5a2914f

Please sign in to comment.