Skip to content

Commit 79c9fd9

Browse files
authored
Merge pull request #6441 from GogoVega/fix-tokencreated-dialog
Fix `TokenCreated` dialog for null tokens
2 parents 4b418dc + 49e852d commit 79c9fd9

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

frontend/src/pages/account/Security/dialogs/TokenCreated.vue

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<ff-dialog ref="dialog" data-el="add-token-confirmation" header="Token Created">
33
<template #default>
4-
<p>Your token is <code>{{ token.token }}</code></p>
4+
<p>Your token is <code>{{ token?.token }}</code></p>
55
<p>This is the only time it will be shown, so please ensure you make a note</p>
66
</template>
77
<template #actions>
@@ -18,14 +18,6 @@ import Alerts from '../../../../services/alerts.js'
1818
export default {
1919
name: 'TokenCreated',
2020
mixins: [clipboardMixin],
21-
setup () {
22-
return {
23-
showToken (token) {
24-
this.token = token
25-
this.$refs.dialog.show()
26-
}
27-
}
28-
},
2921
data () {
3022
return {
3123
token: null
@@ -34,7 +26,7 @@ export default {
3426
methods: {
3527
close () {
3628
this.$refs.dialog.close()
37-
this.token = undefined
29+
this.token = null
3830
},
3931
copy () {
4032
this.copyToClipboard(this.token.token).then(() => {
@@ -43,6 +35,10 @@ export default {
4335
console.warn('Clipboard write permission denied: ', err)
4436
Alerts.emit('Clipboard write permission denied.', 'warning')
4537
})
38+
},
39+
showToken (token) {
40+
this.token = token
41+
this.$refs.dialog.show()
4642
}
4743
}
4844
}

0 commit comments

Comments
 (0)