Skip to content

Commit

Permalink
FIX: stop audio playback on screen exit (#188)
Browse files Browse the repository at this point in the history
  • Loading branch information
frederickbaier authored Feb 1, 2025
2 parents 5ceedff + 14e2e93 commit 9d803e7
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion app/src/screens/ActivityPlayer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,11 @@ export const ActivityPlayer: React.FC = () => {
});
};

const exitActivity = async () => {
await sound.current.unloadAsync();
navigate(Stacks.Auth, { screen: Screens.Home });
};

const isLastStep = currentStep === maxSteps - 1;

return (
Expand Down Expand Up @@ -242,7 +247,7 @@ export const ActivityPlayer: React.FC = () => {
variant='destructive'
className='native:h-20 native:w-20 rounded-xl'
disabled={isReloading}
onPress={() => navigate(Stacks.Auth, { screen: Screens.Home })}
onPress={() => exitActivity()}
>
<IconXboxX className='text-base text-primary-foreground' size={28} />
</Button>
Expand Down

0 comments on commit 9d803e7

Please sign in to comment.