Ver código fonte

声音列表优化

liudan 8 meses atrás
pai
commit
02bb3da915
1 arquivos alterados com 3 adições e 2 exclusões
  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) {