mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2024-12-23 23:47:57 +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) => {
|
.then((url) => {
|
||||||
console.log(url)
|
console.log(url)
|
||||||
event.sender.send('response-get-auth-url', url)
|
event.sender.send('response-get-auth-url', url)
|
||||||
|
// Open authorize url in default browser.
|
||||||
shell.openExternal(url)
|
shell.openExternal(url)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -35,6 +35,7 @@ export default {
|
|||||||
this.$store.commit('Login/changePage', 2)
|
this.$store.commit('Login/changePage', 2)
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
|
loading.close()
|
||||||
this.$message({
|
this.$message({
|
||||||
message: 'Could not search instance',
|
message: 'Could not search instance',
|
||||||
type: 'error'
|
type: 'error'
|
||||||
|
@ -35,10 +35,24 @@ export default {
|
|||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
login () {
|
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)
|
this.$store.dispatch('Login/fetchLogin', this.selectedInstance)
|
||||||
.then((url) => {
|
.then((url) => {
|
||||||
|
loading.close()
|
||||||
this.$router.push({ path: '/authorize' })
|
this.$router.push({ path: '/authorize' })
|
||||||
})
|
})
|
||||||
|
.catch(() => {
|
||||||
|
loading.close()
|
||||||
|
this.$message({
|
||||||
|
message: 'Could not get authorize url',
|
||||||
|
type: 'error'
|
||||||
|
})
|
||||||
|
})
|
||||||
},
|
},
|
||||||
changeInstance (value) {
|
changeInstance (value) {
|
||||||
this.$store.dispatch('Login/changeInstance', value)
|
this.$store.dispatch('Login/changeInstance', value)
|
||||||
|
Loading…
Reference in New Issue
Block a user