diff --git a/src/MainPage.js b/src/MainPage.js
index e88d785..9906c29 100644
--- a/src/MainPage.js
+++ b/src/MainPage.js
@@ -39,6 +39,8 @@ export default function () {
useEffect(() => {
yzs.get_record_list(accessToken, passportId).then(list => {
dispatch(setList(list.result));
+ }).catch(error => {
+ console.log("get list failed", error);
});
}, [accessToken, passportId]);
return
diff --git a/src/PlayerBar.js b/src/PlayerBar.js
index 95a043f..6adc9f4 100644
--- a/src/PlayerBar.js
+++ b/src/PlayerBar.js
@@ -7,7 +7,7 @@ import pauseIcon from "./assets/play.png";
import playIcon from "./assets/pause.png";
import downloadIcon from "./assets/download.png";
import { setCurrentTime, togglePauseState } from "./business/recorderSlice.js"
-import Waveform from "./components/Waveform";
+import ProgressBar from "./components/ProgressBar";
const durationFormat = (time) => {
if (isNaN(time)) return "00:00:00";
@@ -20,11 +20,12 @@ const durationFormat = (time) => {
export default function ({ currentTime }) {
const dispatch = useDispatch();
- const [duration, setDuration] = useState(0);
+ const [duration, setDuration] = useState(0); // 秒,有小数点
const [canvasWidth, setCanvasWidth] = useState(0);
const currentIndex = useSelector(state => state.recorder.currentIndex);
const recordList = useSelector(state => state.recorder.list);
const currentBlob = useSelector(state => state.recorder.currentBlob);
+ const currentWaveData = useSelector(state => state.recorder.currentWaveData);
const pause = useSelector(state => state.recorder.pause);
const player = useRef(null);
useEffect(() => {
@@ -49,7 +50,7 @@ export default function ({ currentTime }) {
}
const onResize = useCallback((width, height) => {
- setCanvasWidth(width - 90 - 60);
+ setCanvasWidth(width - 90 - 70);
}, []);
const { ref: playerBar } = useResizeDetector({
@@ -60,7 +61,7 @@ export default function ({ currentTime }) {
player.current.currentTime = second;
}
- return
-
-
+
+