diff --git a/src/AppRoot.tsx b/src/AppRoot.tsx index 26ae5be8f..921ced0c2 100644 --- a/src/AppRoot.tsx +++ b/src/AppRoot.tsx @@ -473,8 +473,13 @@ class AppRoot extends React.Component { } public startStatusPolling = () => { + console.log('start status polling', { + statusPoller: this.statusPoller, + hardware: this.props.hardware, + }) /* istanbul ignore else */ if (!this.statusPoller) { + console.log('creating statusPoller…') this.statusPoller = IntervalPoller.start( GLOBALS.CARD_POLLING_INTERVAL, async () => { @@ -490,6 +495,9 @@ class AppRoot extends React.Component { const battery = await readBatteryStatus() const cardReader = await readCardReaderStatus() const printer = await readPrinterStatus() + console.log('========== cardReader ============') + console.log({ cardReader }) + console.log('========== cardReader ============') this.setState({ hasAccessibleControllerAttached: accesssibleController.connected, hasCardReaderAttached: cardReader.connected, @@ -498,7 +506,10 @@ class AppRoot extends React.Component { hasPrinterAttached: printer.connected, }) } catch (error) { + console.log('=========== ERROR ===========') + console.log(error) this.stopStatusPolling() // Assume backend is unavailable. + console.log('=========== ERROR ===========') } } ) @@ -862,6 +873,7 @@ class AppRoot extends React.Component { if (hasLowBattery && !hasChargerAttached) { return } + console.log({ hasCardReaderAttached }) if (!hasCardReaderAttached) { return } diff --git a/src/utils/Hardware.ts b/src/utils/Hardware.ts index 7cfd2f665..3695f389f 100644 --- a/src/utils/Hardware.ts +++ b/src/utils/Hardware.ts @@ -176,6 +176,7 @@ export class MemoryHardware implements Hardware { public async readAccesssibleControllerStatus(): Promise< AcessibleControllerAPI > { + console.log("Why is 'this' undefined?", this) return this.accessibleControllerStatus }