Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
beausmith committed Jan 11, 2020
1 parent a1cc75f commit 2fabdc1
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/AppRoot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -473,8 +473,13 @@ class AppRoot extends React.Component<Props, State> {
}

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 () => {
Expand All @@ -490,6 +495,9 @@ class AppRoot extends React.Component<Props, State> {
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,
Expand All @@ -498,7 +506,10 @@ class AppRoot extends React.Component<Props, State> {
hasPrinterAttached: printer.connected,
})
} catch (error) {
console.log('=========== ERROR ===========')
console.log(error)
this.stopStatusPolling() // Assume backend is unavailable.
console.log('=========== ERROR ===========')
}
}
)
Expand Down Expand Up @@ -862,6 +873,7 @@ class AppRoot extends React.Component<Props, State> {
if (hasLowBattery && !hasChargerAttached) {
return <SetupPowerPage setUserSettings={this.setUserSettings} />
}
console.log({ hasCardReaderAttached })
if (!hasCardReaderAttached) {
return <SetupCardReaderPage setUserSettings={this.setUserSettings} />
}
Expand Down
1 change: 1 addition & 0 deletions src/utils/Hardware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ export class MemoryHardware implements Hardware {
public async readAccesssibleControllerStatus(): Promise<
AcessibleControllerAPI
> {
console.log("Why is 'this' undefined?", this)
return this.accessibleControllerStatus
}

Expand Down

0 comments on commit 2fabdc1

Please sign in to comment.