Skip to content

Commit

Permalink
fix(handle loading): fixed handle loading
Browse files Browse the repository at this point in the history
  • Loading branch information
opensrc0 committed Apr 2, 2024
1 parent 137a6c1 commit b112ff2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions __app/component/Scanner/ScannerInit.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import React, { useEffect, useState } from 'react';
import PropTypes from 'prop-types';
import { handleSuccess, handleError, handleLoading } from '../services/handlerService';
import Wrapper from '../Wrapper/Wrapper';

let mediaStream = null;
let videoUnmount = null;
Expand Down Expand Up @@ -214,3 +215,5 @@ ScannerInit.defaultProps = {
zIndex: 9,
cameraType: 'back',
};

export default Wrapper(ScannerInit);
2 changes: 1 addition & 1 deletion __app/component/TextToSpeech/TextToSpeechInit.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ function TextToSpeechInit({
const handlePlay = async () => {
if (TextToSpeechInit.isBrowserSupport()) {
if (text) {
handleLoading(loadingCb);
handleLoading({ loadingCb });
setIsAudioOn(true);
try {
const utteranceCbk = await textToSpeech(text);
Expand Down
2 changes: 1 addition & 1 deletion __app/component/VoiceRecognition/VoiceRecognitionInit.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function VoiceRecognition({

const listen = () => {
if (VoiceRecognition.isBrowserSupport()) {
handleLoading(loadingCb);
handleLoading({ loadingCb });

const SpeechRecognition = globalThis.SpeechRecognition || globalThis.webkitSpeechRecognition;
const recognition = new SpeechRecognition();
Expand Down

0 comments on commit b112ff2

Please sign in to comment.