Fix username

This commit is contained in:
kPherox 2019-04-29 23:19:48 +09:00
parent 4af9362a93
commit b0b978b7a6
No known key found for this signature in database
GPG Key ID: C04751C2BFA2F62D
3 changed files with 9 additions and 9 deletions

View File

@ -48,15 +48,15 @@ export default class AccountAuth extends Vue {
ipcRenderer.send(`new-account-setup`, this.instance) ipcRenderer.send(`new-account-setup`, this.instance)
} }
public authCode() { public authCode() {
ipcRenderer.send(`new-account-auth`, this.code, this.instance)
this.code = ""
this.instance = ''
ipcRenderer.once( ipcRenderer.once(
`login-complete`, `login-complete`,
(e: Event, account: Account) => { (e: Event, account: Account) => {
this.$emit('login-complete', account) this.$emit('login-complete', account)
} }
) )
ipcRenderer.send(`new-account-auth`, this.code, this.instance)
this.code = ""
this.instance = ''
} }
} }
</script> </script>

View File

@ -55,7 +55,7 @@ export default class Welcome extends Vue {
public status: Status = 'welcome' public status: Status = 'welcome'
public loggedIn(account: Account) { public loggedIn(account: Account) {
this.username = `@${account.acct}@${account.domain}` this.username = `${account.acct}@${account.domain}`
this.status = 'select_timeline' this.status = 'select_timeline'
} }
} }

View File

@ -5,7 +5,7 @@ import { join } from "path"
type Protocol = 'http' | 'websocket' type Protocol = 'http' | 'websocket'
export default class Clients { export default class Clients {
// Authorized Accounts. keyには`@username@domain`を設定します // Authorized Accounts. keyには`username@domain`を設定します
private static authorizedHTTP: Map<string, Mastodon> = new Map() private static authorizedHTTP: Map<string, Mastodon> = new Map()
private static authorizedWebSocket: Map<string, Mastodon> = new Map() private static authorizedWebSocket: Map<string, Mastodon> = new Map()
@ -22,7 +22,7 @@ export default class Clients {
filename: join(app.getPath("userData"), "account.db"), filename: join(app.getPath("userData"), "account.db"),
autoload: true autoload: true
}) })
db.find({ full: username }, function(err: any, docs: { domain: string; accessToken: string; }){ db.find({ full: username }, function (err: any, docs: { domain: string; accessToken: string; }) {
if (err) { if (err) {
console.log(err) console.log(err)
} else { } else {