Add: button to timelines with auth

This commit is contained in:
Cutls 2019-04-26 23:37:32 +09:00
parent 7b2cef8c62
commit a802a155c3
2 changed files with 18 additions and 10 deletions

View File

@ -24,23 +24,29 @@ import { Component, Vue } from "vue-property-decorator"
type Instance = string
@Component
export default class Auth extends Vue {
public instance: Instance = ''
public code: string = ''
public domain: string = ''
public instance: Instance = ""
public code: string = ""
public domain: string = ""
public get inputCode(): boolean {
return this.instance !== ''
return this.instance !== ""
}
public addAccount() {
this.instance = this.domain
this.domain = ''
this.domain = ""
ipcRenderer.send(`new-account-setup`, this.instance)
}
public authCode() {
let code = this.code
ipcRenderer.send(`new-account-auth`, code, this.instance)
this.instance = ''
this.code = ""
ipcRenderer.once(
`login-complete`,
(e: Event) => {
}
);
}
}
</script>

View File

@ -68,10 +68,12 @@ export default class Auth {
autoload: true
})
let docs = {
domain: url,
acct: you.acct,
avatar: you.avatar,
avatarStatic: you.avatar_static,
accessToken: tokenData.accessToken
accessToken: tokenData.accessToken,
color: undefined
}
db.insert(docs, function(err, newDocs) {
if (err) {
@ -80,7 +82,7 @@ export default class Auth {
message: "You cannot login already logined account."
})
} else {
event.sender.send(`login-complete`, newDocs)
event.sender.send(`login-complete`)
}
})
})