diff --git a/src/components/cardbuilder/cardBuilder.js b/src/components/cardbuilder/cardBuilder.js index ebdc250d7..c22e6a2b3 100644 --- a/src/components/cardbuilder/cardBuilder.js +++ b/src/components/cardbuilder/cardBuilder.js @@ -390,7 +390,8 @@ import { appRouter } from '../appRouter'; } else if (options.indexBy === 'ProductionYear') { newIndexValue = item.ProductionYear; } else if (options.indexBy === 'CommunityRating') { - newIndexValue = item.CommunityRating ? (Math.floor(item.CommunityRating) + (item.CommunityRating % 1 >= 0.5 ? 0.5 : 0)) + '+' : null; + const roundedRatingDecimal = item.CommunityRating % 1 >= 0.5 ? 0.5 : 0; + newIndexValue = item.CommunityRating ? (Math.floor(item.CommunityRating) + roundedRatingDecimal) + '+' : null; } if (newIndexValue !== currentIndexValue) { diff --git a/src/libraries/scroller.js b/src/libraries/scroller.js index 26b4a8370..49b84e734 100644 --- a/src/libraries/scroller.js +++ b/src/libraries/scroller.js @@ -459,7 +459,8 @@ const scrollerFactory = function (frame, options) { */ function dragHandler(event) { dragging.released = event.type === 'mouseup' || event.type === 'touchend'; - const pointer = dragging.touch ? event[dragging.released ? 'changedTouches' : 'touches'][0] : event; + const eventName = dragging.released ? 'changedTouches' : 'touches'; + const pointer = dragging.touch ? event[eventName][0] : event; dragging.pathX = pointer.pageX - dragging.initX; dragging.pathY = pointer.pageY - dragging.initY; dragging.path = Math.sqrt(Math.pow(dragging.pathX, 2) + Math.pow(dragging.pathY, 2));