@@ -7,14 +7,8 @@ import {
77} from 'react-native-reanimated' ;
88import type { RecordedHaptic , RecordingEvent } from '../types/recording' ;
99import type { HapticEvent , HapticCurve } from 'react-native-ahaps' ;
10- import {
11- startHaptic ,
12- stopAllHaptics ,
13- } from 'react-native-ahaps' ;
14- import {
15- trimHapticDataFromSeekTime ,
16- hapticEventsToRecordingEvents ,
17- } from '../utils/hapticPlayback' ;
10+ import { startHaptic , stopAllHaptics } from 'react-native-ahaps' ;
11+ import { trimHapticDataFromSeekTime } from '../utils/hapticPlayback' ;
1812import { PIXELS_PER_MILLISECOND } from '../components/RecordingTimeline' ;
1913import { scheduleOnRN } from 'react-native-worklets' ;
2014import { storage , STORAGE_KEYS } from '../utils/storage' ;
@@ -60,7 +54,6 @@ const RecorderContext = createContext<RecorderContextValue | null>(null);
6054
6155export function RecorderProvider ( { children } : { children : ReactNode } ) {
6256 const [ recordings , _setRecordings ] = useState < RecordedHaptic [ ] > ( ( ) => {
63- // Load recordings from MMKV on initial mount
6457 try {
6558 const stored = storage . getString ( STORAGE_KEYS . RECORDINGS ) ;
6659 if ( stored ) {
@@ -172,9 +165,6 @@ export function RecorderProvider({ children }: { children: ReactNode }) {
172165
173166 isRecording . set ( false ) ;
174167
175- // Note: The continuous player is managed by MiniContinuousPalette
176- // and will be stopped automatically when the gesture ends
177-
178168 let events = recordingEvents . get ( ) ;
179169
180170 if ( wasContinuousActive ) {
@@ -204,14 +194,13 @@ export function RecorderProvider({ children }: { children: ReactNode }) {
204194 duration,
205195 events : hapticEvents ,
206196 curves : hapticCurves ,
197+ recordingEvents : events ,
207198 } ;
208199
209200 scheduleOnRN ( addRecordingAndSelect , newRecording ) ;
210201
211202 mode . set ( 'playback' ) ;
212- playbackEvents . set (
213- hapticEventsToRecordingEvents ( hapticEvents , hapticCurves )
214- ) ;
203+ playbackEvents . set ( events ) ;
215204 playbackTotalDuration . set ( duration ) ;
216205 playbackTime . set ( 0 ) ;
217206 playbackStartTime . set ( 0 ) ;
@@ -293,9 +282,7 @@ export function RecorderProvider({ children }: { children: ReactNode }) {
293282 const recording = recordings . find ( ( r ) => r . id === id ) ;
294283 if ( recording ) {
295284 mode . set ( 'playback' ) ;
296- playbackEvents . set (
297- hapticEventsToRecordingEvents ( recording . events , recording . curves )
298- ) ;
285+ playbackEvents . set ( recording . recordingEvents ) ;
299286 playbackTotalDuration . set ( recording . duration ) ;
300287 playbackTime . set ( 0 ) ;
301288 playbackStartTime . set ( 0 ) ;
0 commit comments