Skip to content

Commit

Permalink
Do not show toggle if no geomodel present
Browse files Browse the repository at this point in the history
  • Loading branch information
jtklein committed Nov 20, 2024
1 parent 9772108 commit aa4417d
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions example/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ export default function App(): React.JSX.Element {
undefined | string | null
>(undefined);
const [negativeFilter, setNegativeFilter] = useState(false);

const [hasGeoModel, setHasGeoModel] = useState(false);
const [useGeoModel, setUseGeoModel] = useState(false);

enum VIEW_STATUS {
Expand Down Expand Up @@ -127,6 +129,7 @@ export default function App(): React.JSX.Element {
)
.then((result) => {
console.log(`moved geo model file from`, result);
setHasGeoModel(true);
})
.catch((error) => {
console.log(`error moving geo model file`, error);
Expand Down Expand Up @@ -356,10 +359,12 @@ export default function App(): React.JSX.Element {
onPress={() => setViewStatus(VIEW_STATUS.NONE)}
title="Close"
/>
<Button
onPress={toggleUseGeoModel}
title={useGeoModel ? 'Disable Geo Model' : 'Enable Geo Model'}
/>
{hasGeoModel && (
<Button
onPress={toggleUseGeoModel}
title={useGeoModel ? 'Disable Geo Model' : 'Enable Geo Model'}
/>
)}
</View>
</View>
) : (
Expand Down

0 comments on commit aa4417d

Please sign in to comment.