Skip to content

Commit

Permalink
clean: disable search if it is a sunmi printer
Browse files Browse the repository at this point in the history
  • Loading branch information
Atala committed Oct 15, 2024
1 parent 4cdecdd commit 443511d
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/navigation/restaurant/Printer.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
import {
selectAutoAcceptOrdersEnabled,
selectAutoAcceptOrdersPrintNumberOfCopies,
selectIsSunmiPrinter,
selectPrinter,
} from '../../redux/Restaurant/selectors';
import { useBackgroundContainerColor } from '../../styles/theme';
Expand Down Expand Up @@ -77,6 +78,7 @@ function PrinterComponent({ devices, isScanning, _onPressScan }) {
const printNumberOfCopies = useSelector(
selectAutoAcceptOrdersPrintNumberOfCopies,
);
const isSumniPrinter = useSelector(selectIsSunmiPrinter)

const backgroundColor = useBackgroundContainerColor();

Expand All @@ -85,6 +87,7 @@ function PrinterComponent({ devices, isScanning, _onPressScan }) {
const dispatch = useDispatch();

let items = [];

if (printer) {
items.push({ ...printer, isConnected: true });
} else {
Expand All @@ -93,6 +96,12 @@ function PrinterComponent({ devices, isScanning, _onPressScan }) {

const hasItems = !isScanning && items.length > 0;

if (isSumniPrinter) {
return(<View style={styles.item}>
<Text>The device has an internal Sunmi Printer, no need to connect it</Text>
</View>)
}

if (!hasItems) {
return (
<Center flex={1}>
Expand Down

0 comments on commit 443511d

Please sign in to comment.