Skip to content

Commit

Permalink
UIREQ-1145 - refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
manvendra-s-rathore committed Sep 27, 2024
1 parent 9b3cabc commit d212ff5
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions src/routes/RequestsRoute.js
Original file line number Diff line number Diff line change
Expand Up @@ -1321,7 +1321,9 @@ class RequestsRoute extends React.Component {
);

onAfterPrintForSinglePrintButton = () => {
this.props.mutator.resultOffset.replace(0);
if (this.state.isViewPrintDetailsEnabled) {
this.props.mutator.resultOffset.replace(0);
}
}

printContentRefs = {};
Expand Down Expand Up @@ -1520,11 +1522,7 @@ class RequestsRoute extends React.Component {
await this.savePrintEventDetails(requestIds);
}
}}
onAfterPrint={() => {
if (isViewPrintDetailsEnabled) {
mutator.resultOffset.replace(0);
}
}}
onAfterPrint={() => this.onAfterPrintForSinglePrintButton()}
>
<FormattedMessage
id="ui-requests.printPickSlips"
Expand Down Expand Up @@ -1556,12 +1554,7 @@ class RequestsRoute extends React.Component {
}
}
}
onAfterPrint={() => {
if (isViewPrintDetailsEnabled && resources.resultOffset) {
mutator.resultOffset.replace(0);
this.setState({ selectedRows: {} });
}
}}
onAfterPrint={() => this.onAfterPrintForSinglePrintButton()}
>
<FormattedMessage
id="ui-requests.printPickSlipsSelected"
Expand Down

0 comments on commit d212ff5

Please sign in to comment.