correctly set error in add.html
This commit is contained in:
parent
29b9da64d4
commit
c93141daed
|
@ -9,12 +9,6 @@ import { updateVerifyCredentialsForInstance } from './[instanceName]'
|
||||||
const REDIRECT_URI = (typeof location !== 'undefined' ?
|
const REDIRECT_URI = (typeof location !== 'undefined' ?
|
||||||
location.origin : 'https://pinafore.social') + '/settings/instances/add'
|
location.origin : 'https://pinafore.social') + '/settings/instances/add'
|
||||||
|
|
||||||
store.onchange((state, changed) => {
|
|
||||||
if (changed['instanceNameInSearch']) {
|
|
||||||
store.set({logInToInstanceError: false})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
async function redirectToOauth() {
|
async function redirectToOauth() {
|
||||||
let instanceName = store.get('instanceNameInSearch')
|
let instanceName = store.get('instanceNameInSearch')
|
||||||
let loggedInInstances = store.get('loggedInInstances')
|
let loggedInInstances = store.get('loggedInInstances')
|
||||||
|
@ -42,6 +36,7 @@ async function redirectToOauth() {
|
||||||
|
|
||||||
export async function logInToInstance() {
|
export async function logInToInstance() {
|
||||||
store.set({logInToInstanceLoading: true})
|
store.set({logInToInstanceLoading: true})
|
||||||
|
store.set({logInToInstanceError: null})
|
||||||
try {
|
try {
|
||||||
await redirectToOauth()
|
await redirectToOauth()
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
|
|
Loading…
Reference in a new issue