Browse Source

声音列表优化

liudan 8 months ago
parent
commit
02bb3da915
1 changed files with 3 additions and 2 deletions
  1. 3 2
      src/pages/home/Index.jsx

+ 3 - 2
src/pages/home/Index.jsx

@@ -201,10 +201,11 @@ class Home extends React.Component {
         if (!data.path || !data.voiceFileName) {
           return;
         }
-        this.state.voiceList.push(data.path + data.voiceFileName);
+        const voiceList = this.state.voiceList;
+        // this.state.voiceList.push(data.path + data.voiceFileName);
         this.setState(
           {
-            voiceList: this.state.voiceList,
+            voiceList: [...voiceList, data.path + data.voiceFileName],
           },
           () => {
             if (!this.state.myStatus) {