Skip to content

Commit

Permalink
refactor(types): fix some type errors in Farmhand component
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremyckahn committed Aug 3, 2023
1 parent c936467 commit 9a7a245
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
13 changes: 9 additions & 4 deletions src/components/Farmhand/Farmhand.js
Original file line number Diff line number Diff line change
Expand Up @@ -1149,8 +1149,11 @@ export default class Farmhand extends FarmhandReducers {
// shown to the player when the app reloads.
newDayNotifications: pendingNotifications,
})
;[]
.concat(pendingNotifications)

/** @type {farmhand.notification[]} */
const notifications = [...pendingNotifications]

notifications
.concat(
isFirstDay
? []
Expand Down Expand Up @@ -1197,7 +1200,7 @@ export default class Farmhand extends FarmhandReducers {
}

focusNextView() {
if (document.activeElement.getAttribute('role') === 'tab') return
if (document.activeElement?.getAttribute('role') === 'tab') return

const { viewList } = this

Expand All @@ -1209,7 +1212,7 @@ export default class Farmhand extends FarmhandReducers {
}

focusPreviousView() {
if (document.activeElement.getAttribute('role') === 'tab') return
if (document.activeElement?.getAttribute('role') === 'tab') return

const { viewList } = this

Expand Down Expand Up @@ -1347,6 +1350,8 @@ export default class Farmhand extends FarmhandReducers {
position="static"
activeStep={viewList.indexOf(this.state.stageFocus)}
className=""
backButton={null}
nextButton={null}
/>
<div className="fab-buttons buttons">
<Fab
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
* @typedef farmhand.notification
* @type {Object}
* @property {'error'|'info'|'success'|'warning'} severity
* @property {Function?} onClick
* @property {Function=} onClick
* @property {string} message
*/

Expand Down

0 comments on commit 9a7a245

Please sign in to comment.