Skip to content

Commit

Permalink
Update half-tap analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
wyne committed Mar 22, 2024
1 parent 5d3e11d commit 4774d43
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/components/Interactions/HalfTap/HalfTileTouchSurface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ export const HalfTileTouchSurface: React.FunctionComponent<Props> = (
setParticles((particles) => [...particles, { key, value }]);
};

const scoreChangeHandler = (addend: number) => {
const scoreChangeHandler = (addend: number, powerHold = false) => {
if (currentGame.locked) return;

if (showPointParticles) {
Expand All @@ -61,6 +61,8 @@ export const HalfTileTouchSurface: React.FunctionComponent<Props> = (
addend: addend,
round: roundCurrent,
type: scoreType,
power_hold: powerHold,
interaction: 'half-tap',
});
dispatch(playerRoundScoreIncrement(playerId, roundCurrent, scoreType == 'increment' ? addend : -addend));
};
Expand All @@ -71,7 +73,7 @@ export const HalfTileTouchSurface: React.FunctionComponent<Props> = (
underlayColor={currentGame.locked ? 'transparent' : fontColor + '30'}
activeOpacity={1}
onPress={() => scoreChangeHandler(addendOne)}
onLongPress={() => scoreChangeHandler(addendTwo)}>
onLongPress={() => scoreChangeHandler(addendTwo, true)}>
<View style={[StyleSheet.absoluteFill]}>
{particles.map((particle) => (
<ScoreParticle key={particle.key} id={particle.key} value={particle.value} />
Expand Down

0 comments on commit 4774d43

Please sign in to comment.