Skip to content

Commit

Permalink
#24: Updated dialog rendering, removed autologin
Browse files Browse the repository at this point in the history
  • Loading branch information
roryschadler committed Mar 21, 2022
1 parent aafbc49 commit f5edbc4
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions app/src/components/nanomine/DatasetViewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<template v-slot:title>{{ dialog.title }}</template>
<template v-slot:content>{{ dialog.content }}</template>
<template v-slot:actions>
<md-button @click.native.prevent="dialog.closeHandler">Close</md-button>
<md-button @click.native.prevent="toggleDialogBox">Close</md-button>
</template>
</dialog-box>
<!--
Expand Down Expand Up @@ -142,7 +142,7 @@ export default {
// AUTH MOCKED because auth is not yet implemented
getUserID: () => '0',
getRunAsUser: () => false,
isLoggedIn: () => true
isLoggedIn: () => false
},
dialogBoxActive: false,
dialog: {}
Expand Down Expand Up @@ -225,8 +225,10 @@ export default {
})
})
.catch(function (err) {
vm.datasetsError = true
vm.renderDialog('Datasets Error', `fetching datasets: ${err}`)
vm.datasetsError = err
if (vm.auth.isLoggedIn()) {
vm.renderDialog('Datasets Error', 'Please try again later.')
}
})
},
transformDataset (entry) {
Expand Down Expand Up @@ -300,8 +302,8 @@ export default {
vm.getDatasets()
})
.catch(function (err) {
vm.datasetsError = true
vm.renderDialog('Dataset Error', err.message)
vm.datasetsError = err
vm.renderDialog('Dataset Error', 'Please make sure you are logged in, or try again later.')
})
},
toggleDialogBox () {
Expand All @@ -310,8 +312,7 @@ export default {
renderDialog (title, content, closeHandler) {
this.dialog = {
title,
content,
closeHandler: closeHandler || this.toggleDialogBox
content
}
this.toggleDialogBox()
},
Expand Down

0 comments on commit f5edbc4

Please sign in to comment.