feat: allow key enter for sign in (#142)
parent
0f0acd4824
commit
39de2c36a6
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue