Skip to content

Commit

Permalink
#1292 | Debounce the onCardPress action for CustomDashboardCard, to a…
Browse files Browse the repository at this point in the history
…void triggering multiple transitions
  • Loading branch information
himeshr committed Feb 26, 2024
1 parent ffbaa80 commit 21458ca
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ export default class CustomDashboardCard extends AbstractComponent {

render() {
const {reportCard, index, viewType, onCardPress, countResult, countUpdateTime } = this.props;
const onCardPressOp = _.debounce(onCardPress, 500);
return viewType === 'Tile' ?
<CardTileView reportCard={reportCard} I18n={this.I18n} onCardPress={onCardPress} index={index} countResult={countResult} /> :
<CardListView reportCard={reportCard} I18n={this.I18n} onCardPress={onCardPress} countResult={countResult} />
<CardTileView reportCard={reportCard} I18n={this.I18n} onCardPress={onCardPressOp} index={index} countResult={countResult} /> :
<CardListView reportCard={reportCard} I18n={this.I18n} onCardPress={onCardPressOp} countResult={countResult} />
}

}

0 comments on commit 21458ca

Please sign in to comment.