@quintype/native-components 2.29.8 → 2.29.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@quintype/native-components",
3
- "version": "2.29.8",
3
+ "version": "2.29.9",
4
4
  "description": "",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -18,7 +18,7 @@ import { Player } from '../AudioPlayer';
18
18
  import TrackPlayer, { usePlaybackState, Capability, State, useProgress } from "react-native-track-player";
19
19
  import MaterialIcon from "react-native-vector-icons/MaterialCommunityIcons";
20
20
  import {Comments} from '../Comments'
21
-
21
+ import { isDetox } from 'react-native-is-detox';
22
22
  import Modal from 'react-native-modal';
23
23
  import { SCREEN_LIST } from '../../../../../../src/constants/screen-mapping';
24
24
  import { COMP_GENERAL_CONSTANTS } from '../../constants/component-constants';
@@ -160,8 +160,9 @@ export const Story = ({
160
160
  const cards = story?.cards ?? [];
161
161
  const [showModal, setShowModal] = useState(false);
162
162
  const [audioRate, setAudioRate] = useState(1);
163
+ const [progressInterval, setProgressInterval] = useState(undefined);
163
164
  const playbackState = usePlaybackState();
164
- const progress = useProgress();
165
+ const progress = useProgress(progressInterval);
165
166
  const [isFinishedPlaying, setFinishedPlaying] = useState(false);
166
167
 
167
168
 
@@ -240,6 +241,14 @@ export const Story = ({
240
241
  return async() => await TrackPlayer.pause();
241
242
  }, []);
242
243
 
244
+ useEffect(() => {
245
+ const checkDetox = async () => {
246
+ const isRunningInDetox = await isDetox();
247
+ setProgressInterval(isRunningInDetox ? 2000 : undefined);
248
+ };
249
+ checkDetox();
250
+ }, []);
251
+
243
252
  useEffect(()=>{
244
253
  if(progress?.duration < progress.position + 1 && progress.position !== 0){
245
254
  setFinishedPlaying(true);