Skip to content

Commit

Permalink
refactor: auto copy changed rpc secret
Browse files Browse the repository at this point in the history
  • Loading branch information
agalwood committed Jun 22, 2019
1 parent d2f8a45 commit 8a90045
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/renderer/components/Preference/Advanced.vue
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,13 @@
})
},
watch: {
'form.rpcSecret': function (val) {
const url = buildRpcUrl({
port: this.form.rpcListenPort,
secret: val
})
clipboard.writeText(url)
}
},
methods: {
isRenderer: is.renderer,
Expand Down Expand Up @@ -301,11 +308,7 @@
this.hideRpcSecret = false
const rpcSecret = randomize('Aa0', 12)
this.form.rpcSecret = rpcSecret
const url = buildRpcUrl({
port: this.form.rpcListenPort,
secret: rpcSecret
})
clipboard.writeText(url)
setTimeout(() => {
this.hideRpcSecret = true
}, 2000)
Expand Down

0 comments on commit 8a90045

Please sign in to comment.