Skip to content

Commit

Permalink
fix: Changed disconnection stream
Browse files Browse the repository at this point in the history
Remade disconnection stream to make sure UI
tries to reconenct to local network straight away
when starting the app
  • Loading branch information
BKristenssonAlfsson committed May 1, 2020
1 parent c493f40 commit f457ab4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
2 changes: 2 additions & 0 deletions src/views/ChooseEdgeConnection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
</template>
<script>
import AppFrame from '@/components/AppFrame.vue'
import { REMOVE_REMOTE_PEER_ID } from '../store/action-types.js'
export default {
data: () => {
Expand Down Expand Up @@ -86,6 +87,7 @@ export default {
},
sendEdgeAddress () {
this.$store.state.pnp.edgeRoom = this.edgeAddress
this.$store.dispatch(REMOVE_REMOTE_PEER_ID)
}
},
components: {
Expand Down
22 changes: 8 additions & 14 deletions src/views/EdgeConnect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@
OK
</v-btn>
<router-link :to="'choose-edge-connection'">
<v-btn>Disconnect</v-btn>
<v-btn @click="disconnectEdge">
Disconnect
</v-btn>
</router-link>
</v-card>
</v-col>
Expand Down Expand Up @@ -168,6 +170,7 @@
<script>
import AppFrame from '@/components/AppFrame.vue'
// import { settingsDB } from '@/store/db'
import { /* CLEAR_CONNECTION */ REMOVE_REMOTE_PEER_ID } from '../store/action-types.js'
import { mapState } from 'vuex'
import {
PEER_DISCONNECTED,
Expand Down Expand Up @@ -229,26 +232,17 @@ export default {
components: {
AppFrame
},
mounted () {
this.loadSettings()
},
destroyed () {
// Disconnect yourself when leaving this component
// if (this.$store.state.pnp.peerConnectionStatus === PEER_CONNECTED) {
// this.$store.dispatch(REMOVE_REMOTE_PEER_ID)
// this.$store.state.pnp.remotePeerId = null
// this.$store.state.pnp.edgeRoom = undefined
// }
},
methods: {
// resetEdgeConnection () {
// this.resetEdgeDialog = false
// this.removeEdgeId()
// },
loadSettings () {
},
saveSettings () {
// settingsDB.set('ambanic-edge-address', this.edgeAddress)
disconnectEdge () {
this.$store.state.pnp.remotePeerId = null
this.$store.state.pnp.edgeRoom = undefined
this.$store.dispatch(REMOVE_REMOTE_PEER_ID)
}
}
}
Expand Down

0 comments on commit f457ab4

Please sign in to comment.