Skip to content

Commit

Permalink
support Invalid location registration for mPOS readers. (#692)
Browse files Browse the repository at this point in the history
  • Loading branch information
ianlin-bbpos authored May 9, 2024
1 parent afe3fe8 commit 17ff02e
Showing 1 changed file with 34 additions and 30 deletions.
64 changes: 34 additions & 30 deletions dev-app/src/screens/DiscoverReadersScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,37 +291,41 @@ export default function DiscoverReadersScreen() {
testID="discovery-readers-screen"
contentContainerStyle={styles.container}
>
<List title="SELECT LOCATION">
<ListItem
onPress={() => {
if (!simulated) {
navigation.navigate('LocationListScreen', {
onSelect: (location: Location) => setSelectedLocation(location),
});
{discoveryMethod != 'internet' && (
<List title="SELECT LOCATION">
<ListItem
onPress={() => {
if (!simulated) {
navigation.navigate('LocationListScreen', {
onSelect: (location: Location) =>
setSelectedLocation(location),
showDummyLocation: true,
});
}
}}
disabled={simulated}
title={
simulated
? 'Mock simulated reader location'
: selectedLocation?.displayName || 'No location selected'
}
}}
disabled={simulated}
title={
simulated
? 'Mock simulated reader location'
: selectedLocation?.displayName || 'No location selected'
}
/>

{simulated ? (
<Text style={styles.infoText}>
Simulated readers are always registered to the mock simulated
location.
</Text>
) : (
<Text style={styles.infoText}>
Bluetooth readers must be registered to a location during the
connection process. If you do not select a location, the reader will
attempt to register to the same location it was registered to during
the previous connection.
</Text>
)}
</List>
/>

{simulated ? (
<Text style={styles.infoText}>
Simulated readers are always registered to the mock simulated
location.
</Text>
) : (
<Text style={styles.infoText}>
Bluetooth readers must be registered to a location during the
connection process. If you do not select a location, the reader
will attempt to register to the same location it was registered to
during the previous connection.
</Text>
)}
</List>
)}

{simulated && discoveryMethod !== 'internet' && (
<List title="SIMULATED UPDATE PLAN">
Expand Down

0 comments on commit 17ff02e

Please sign in to comment.