File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
package/src/components/Attachment/Audio Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ import {
1515import { PlayPauseButton } from './PlayPauseButton' ;
1616
1717import { useTheme } from '../../../contexts' ;
18+ import { useStableCallback } from '../../../hooks' ;
1819import { useStateStore } from '../../../hooks' ;
1920import { useAudioPlayer } from '../../../hooks/useAudioPlayer' ;
2021import {
@@ -168,14 +169,14 @@ export const AudioAttachment = (props: AudioAttachmentProps) => {
168169 await audioPlayer . stop ( ) ;
169170 } ;
170171
171- const dragStart = ( ) => {
172+ const dragStart = useStableCallback ( ( ) => {
172173 audioPlayer . pause ( ) ;
173- } ;
174+ } ) ;
174175
175- const dragEnd = async ( currentProgress : number ) => {
176+ const dragEnd = useStableCallback ( async ( currentProgress : number ) => {
176177 const positionInSeconds = ( currentProgress * duration ) / ONE_SECOND_IN_MILLISECONDS ;
177178 await audioPlayer . seek ( positionInSeconds ) ;
178- } ;
179+ } ) ;
179180
180181 const onSpeedChangeHandler = async ( ) => {
181182 await audioPlayer . changePlaybackRate ( ) ;
You can’t perform that action at this time.
0 commit comments