-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Try to fix multiple printer tickets #1903
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -567,7 +567,10 @@ export default (state = initialState, action = {}) => { | |
const printTask = state.ordersToPrint[orderId]; | ||
|
||
if (!printTask) { | ||
return state; | ||
return { | ||
...state, | ||
printingOrderId: null, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My idea was that only There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you see a situation when it was not working? |
||
}; | ||
} | ||
|
||
if (printTask.copiesToPrint > 1) { | ||
|
@@ -603,7 +606,10 @@ export default (state = initialState, action = {}) => { | |
const printTask = state.ordersToPrint[orderId]; | ||
|
||
if (!printTask) { | ||
return state; | ||
return { | ||
...state, | ||
printingOrderId: null, | ||
}; | ||
} | ||
|
||
return { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -244,3 +244,8 @@ export const selectIsActionable = createSelector( | |
); | ||
}, | ||
); | ||
|
||
export const selectIsPrinting = createSelector( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There is a selector called |
||
state => state.restaurant.printingOrderId, | ||
(printingOrderId) => printingOrderId !== null | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be honest, I don't see much value in passing these props through three components (Order.js > OrderHeading.js > OrderButtons.js). I would put them in
OrderButtons
directly