feat: allow key enter for sign in (#142)

This commit is contained in:
Shinigami 2022-11-26 19:07:31 +01:00 committed by GitHub
parent 0f0acd4824
commit 39de2c36a6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4,6 +4,9 @@ import { DEFAULT_SERVER } from '~/constants'
let server = $ref<string>('')
async function oauth() {
if (!server)
return
server = server.split('/')[0]
location.href = `/api/${server || DEFAULT_SERVER}/login`
}
@ -22,7 +25,7 @@ async function handleInput() {
<div>Mastodon Server Name</div>
<div flex bg-gray:10 px2 py1 mxa rounded border="~ border" text-xl items-center>
<span op35 mr1 text-sm>https://</span>
<input v-model="server" :placeholder="DEFAULT_SERVER" outline-none bg-transparent @input="handleInput">
<input v-model="server" :placeholder="DEFAULT_SERVER" outline-none bg-transparent @input="handleInput" @keyup.enter="oauth()">
</div>
<button btn-solid mt2 @click="oauth()">
Sign in