File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -114,6 +114,8 @@ const Connection: React.FC<ConnectionProps> = ({
114114 const existingRecordRef = useRef < any | undefined > ( undefined ) ;
115115 const devicenameref = useRef < string > ( "" ) ;
116116 const [ deviceReady , setDeviceReady ] = useState ( false ) ;
117+ const sampingrateref = useRef < number > ( 0 ) ;
118+
117119
118120 // UI Themes & Modes
119121 const { theme } = useTheme ( ) ; // Current theme of the app
@@ -540,6 +542,7 @@ const Connection: React.FC<ConnectionProps> = ({
540542
541543 if ( sampling_rate ) {
542544 setCurrentSamplingRate ( sampling_rate ) ;
545+ sampingrateref . current = sampling_rate ;
543546 }
544547
545548 return {
@@ -891,10 +894,10 @@ const Connection: React.FC<ConnectionProps> = ({
891894 const notchFilters = Array . from ( { length : maxCanvasElementCountRef . current } , ( ) => new Notch ( ) ) ;
892895 const EXGFilters = Array . from ( { length : maxCanvasElementCountRef . current } , ( ) => new EXGFilter ( ) ) ;
893896 notchFilters . forEach ( ( filter ) => {
894- filter . setbits ( currentSamplingRate ) ; // Set the bits value for all instances
897+ filter . setbits ( sampingrateref . current ) ; // Set the bits value for all instances
895898 } ) ;
896899 EXGFilters . forEach ( ( filter ) => {
897- filter . setbits ( detectedBitsRef . current . toString ( ) , currentSamplingRate ) ; // Set the bits value for all instances
900+ filter . setbits ( detectedBitsRef . current . toString ( ) , sampingrateref . current ) ; // Set the bits value for all instances
898901 } ) ;
899902 try {
900903 while ( isDeviceConnectedRef . current ) {
You can’t perform that action at this time.
0 commit comments