mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2024-12-23 15:37:59 +01:00
Merge pull request #19 from h3poteto/iss-7
refs #7 Add loading in login button
This commit is contained in:
commit
89b1e8898d
@ -68,6 +68,7 @@ ipcMain.on('get-auth-url', (event, domain) => {
|
||||
.then((url) => {
|
||||
console.log(url)
|
||||
event.sender.send('response-get-auth-url', url)
|
||||
// Open authorize url in default browser.
|
||||
shell.openExternal(url)
|
||||
})
|
||||
})
|
||||
|
@ -35,6 +35,7 @@ export default {
|
||||
this.$store.commit('Login/changePage', 2)
|
||||
})
|
||||
.catch(() => {
|
||||
loading.close()
|
||||
this.$message({
|
||||
message: 'Could not search instance',
|
||||
type: 'error'
|
||||
|
@ -35,10 +35,24 @@ export default {
|
||||
},
|
||||
methods: {
|
||||
login () {
|
||||
const loading = this.$loading({
|
||||
lock: true,
|
||||
text: 'Loading',
|
||||
spinner: 'el-icon-loading',
|
||||
background: 'rgba(0, 0, 0, 0.7)'
|
||||
})
|
||||
this.$store.dispatch('Login/fetchLogin', this.selectedInstance)
|
||||
.then((url) => {
|
||||
loading.close()
|
||||
this.$router.push({ path: '/authorize' })
|
||||
})
|
||||
.catch(() => {
|
||||
loading.close()
|
||||
this.$message({
|
||||
message: 'Could not get authorize url',
|
||||
type: 'error'
|
||||
})
|
||||
})
|
||||
},
|
||||
changeInstance (value) {
|
||||
this.$store.dispatch('Login/changeInstance', value)
|
||||
|
Loading…
Reference in New Issue
Block a user