Skip to content

Commit

Permalink
fix(ui): including a node shows security class twice
Browse files Browse the repository at this point in the history
Fixes #2321
  • Loading branch information
robertsLando committed Aug 8, 2022
1 parent 5c2434f commit 1178e16
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 12 deletions.
31 changes: 20 additions & 11 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,14 @@ export default {
},
name: 'app',
computed: {
...mapGetters(['user', 'auth', 'appInfo', 'navTabs', 'darkMode']),
...mapGetters([
'user',
'auth',
'appInfo',
'navTabs',
'darkMode',
'nodesManagerOpen',
]),
updateAvailable() {
return this.appInfo.newConfigVersion ? 1 : 0
},
Expand Down Expand Up @@ -466,21 +473,23 @@ export default {
this.dialog_password = true
},
async onNodeAdded({ node }) {
await this.confirm(
'Node added',
`<div class="d-flex flex-column align-center col">
if (!this.nodesManagerOpen) {
await this.confirm(
'Node added',
`<div class="d-flex flex-column align-center col">
<i aria-hidden="true" class="v-icon notranslate material-icons theme--light success--text" style="font-size: 60px;">check_circle</i>
<p class="mt-3 headline text-center">
Node ${node.id} added with security "${node.security || 'None'}"
</p>
</div>`,
'info',
{
width: 500,
confirmText: 'Close',
cancelText: '',
}
)
'info',
{
width: 500,
confirmText: 'Close',
cancelText: '',
}
)
}
},
toggleDrawer() {
if (
Expand Down
1 change: 1 addition & 0 deletions src/components/dialogs/DialogNodesManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -736,6 +736,7 @@ export default {
watch: {
value(v) {
this.init(v)
this.$store.commit('setNodesManagerOpen', v)
},
commandEndDate(newVal) {
if (this.commandTimer) {
Expand Down
7 changes: 6 additions & 1 deletion src/store/mutations.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const settings = new Settings(localStorage);

export const state = {
auth: undefined,
nodesManagerOpen: false,
serial_ports: [],
scales: [],
nodes: [],
Expand Down Expand Up @@ -113,7 +114,8 @@ export const getters = {
appInfo: state => state.appInfo,
scales: state => state.scales,
darkMode: state => state.ui.darkMode,
navTabs: state => state.ui.navTabs
navTabs: state => state.ui.navTabs,
nodesManagerOpen: state => state.nodesManagerOpen
}

export const actions = {
Expand Down Expand Up @@ -167,6 +169,9 @@ export const mutations = {
showSnackbar() {
// empty mutation, will be caught in App.vue from store subscribe
},
setNodesManagerOpen(store, opened) {
state.nodesManagerOpen = opened
},
setAuth(store, enabled) {
state.auth = enabled
},
Expand Down

0 comments on commit 1178e16

Please sign in to comment.