QueennN 4 年之前
父节点
当前提交
f107203ae1
共有 2 个文件被更改,包括 2 次插入2 次删除
  1. 1 1
      src/components/myconnections.vue
  2. 1 1
      src/store/index.js

+ 1 - 1
src/components/myconnections.vue

@@ -2,7 +2,7 @@
     <b-card bg-variant="primary" header="My Connections" text-variant="white">
         <b-card-text>
             <div>
-                <div variant="light" v-for="call in $store.state.myCalls" :key="call">
+                <div variant="light" v-for="call in $store.state.myConnections" :key="call.peer">
                     {{call.peer}}
                      <b-button @click="$store.commit('close',call.peer)">Close</b-button>
                     </div>

+ 1 - 1
src/store/index.js

@@ -32,7 +32,7 @@ export const store = new Vuex.Store({
             let myConnectionIndex = state.myConnections.findIndex(item => item.peer == connectId)
             let myCallIndex = state.myCalls.findIndex(item => item.peer == connectId)
 
-            state.myConnections[myConnectionIndex].send('PAIR_CLOSED')
+            if (myConnectionIndex != -1) state.myConnections[myConnectionIndex].send('PAIR_CLOSED')
 
             if (callIndex != -1) state.receiveCalls[callIndex].close()
             if (connectionIndex != -1) state.receiveConnections[connectionIndex].close()