Skip to content

Commit

Permalink
fix: vuetify warnings and initilization of app
Browse files Browse the repository at this point in the history
The app will start looking for an Edge device asap the UI is entered.
Fixed all vuetify warnings that was showing up in views components.
  • Loading branch information
BKristenssonAlfsson committed May 1, 2020
1 parent 2674ca7 commit 6f3545d
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 29 deletions.
7 changes: 6 additions & 1 deletion src/store/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Vue from 'vue'
import Vuex from 'vuex'
import PNPStore from './pnp.js'

import { INITIALIZE_PNP } from './action-types.js'
import { UPDATE_AVAILABLE } from './mutation-types'

Vue.use(Vuex)
Expand All @@ -23,4 +23,9 @@ const store = new Vuex.Store({
}
})

/**
Begin connection attempt to Ambianic Edge as soon as the app is created
*/
store.dispatch(INITIALIZE_PNP)

export default store
10 changes: 6 additions & 4 deletions src/views/About.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,18 @@
Review your home timeline for notable moments.
Configure input sensors and cameras for Ambianic to observe.
Share, purge or backup your data
- it never slips out of your control.
- it never slips out of your control.
</v-card-text>

<v-list-item
align="center"
justify="center"
align="center"
justify="center"
>
<v-list-item-content>
<v-list-item-title>
<v-icon class="mx-n2">mdi-alpha-v</v-icon>
<v-icon class="mx-n2">
mdi-alpha-v
</v-icon>
{{ version }}
</v-list-item-title>
<v-list-item-subtitle>Release Version</v-list-item-subtitle>
Expand Down
8 changes: 0 additions & 8 deletions src/views/ChooseEdgeConnection.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,6 @@
</template>
<script>
import AppFrame from '@/components/AppFrame.vue'
import { REMOVE_REMOTE_PEER_ID } from '../store/action-types'
import { PEER_CONNECTED } from '../store/mutation-types'
export default {
data: () => {
Expand Down Expand Up @@ -90,12 +88,6 @@ export default {
this.$store.state.pnp.edgeRoom = this.edgeAddress
}
},
mounted () {
// If you route back to this page, disconnect so you can reconnect to another ID
if (this.$store.state.pnp.peerConnectionStatus === PEER_CONNECTED) {
this.$store.dispatch(REMOVE_REMOTE_PEER_ID)
}
},
components: {
AppFrame
},
Expand Down
15 changes: 5 additions & 10 deletions src/views/EdgeConnect.vue
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,6 @@
<script>
import AppFrame from '@/components/AppFrame.vue'
// import { settingsDB } from '@/store/db'
import { INITIALIZE_PNP, REMOVE_REMOTE_PEER_ID } from '../store/action-types.js'
import { mapState } from 'vuex'
import {
PEER_DISCONNECTED,
Expand Down Expand Up @@ -235,22 +234,18 @@ export default {
},
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
}
// 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 () {
/**
Begin connection attempt to Ambianic Edge as soon as the app is created
*/
this.$store.dispatch(INITIALIZE_PNP)
},
saveSettings () {
// settingsDB.set('ambanic-edge-address', this.edgeAddress)
Expand Down
8 changes: 4 additions & 4 deletions src/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
height="194"
/>

<v-card-text id='welcome-text'>
<v-card-text id="welcome-text">
Review your home timeline for notable moments.
Configure input sensors and camers for Ambianic to observe.
Share, purge or backup your data
- it never slips out of your control.
- it never slips out of your control.
</v-card-text>

<v-card-actions>
Expand All @@ -47,7 +47,7 @@
dark
class="ma-2 white--text"
:to="'timeline'"
id='btn-timeline'
id="btn-timeline"
>
View Timeline
<v-icon
Expand All @@ -63,7 +63,7 @@
dark
class="ma-2 white--text"
:to="'settings'"
id='btn-settings'
id="btn-settings"
>
Settings
<v-icon
Expand Down
3 changes: 1 addition & 2 deletions src/views/Timeline.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@
indeterminate
:size="50"
:width="7"
>
</v-progress-linear>
/>
</v-card-title>

<v-card-text>
Expand Down

0 comments on commit 6f3545d

Please sign in to comment.