mirror of
https://github.com/pockethost/pockethost.git
synced 2025-07-03 11:22:29 +00:00
fix: dashboard onMount issue (rare)
This commit is contained in:
parent
efdaf533d8
commit
0736b82d02
@ -7,6 +7,7 @@
|
|||||||
import NewInstanceProcessingBlock from './NewInstanceProcessingBlock.svelte'
|
import NewInstanceProcessingBlock from './NewInstanceProcessingBlock.svelte'
|
||||||
import Fa from 'svelte-fa'
|
import Fa from 'svelte-fa'
|
||||||
import { faArrowRight, faRotate } from '@fortawesome/free-solid-svg-icons'
|
import { faArrowRight, faRotate } from '@fortawesome/free-solid-svg-icons'
|
||||||
|
import { onMount } from 'svelte'
|
||||||
|
|
||||||
export let isSignUpView: boolean = false
|
export let isSignUpView: boolean = false
|
||||||
let isProcessing: boolean = false
|
let isProcessing: boolean = false
|
||||||
@ -30,34 +31,38 @@
|
|||||||
instanceNameField.set(name)
|
instanceNameField.set(name)
|
||||||
}
|
}
|
||||||
|
|
||||||
instanceNameField.subscribe(async (name) => {
|
onMount(() => {
|
||||||
if (name === $instanceInfo.name) return
|
instanceNameField.subscribe(async (name) => {
|
||||||
try {
|
if (name === $instanceInfo.name) return
|
||||||
instanceInfo.update((info) => ({
|
try {
|
||||||
...info,
|
instanceInfo.update((info) => ({
|
||||||
fetching: true,
|
...info,
|
||||||
}))
|
fetching: true,
|
||||||
const res = await client().client.send(
|
}))
|
||||||
`/api/signup?name=${encodeURIComponent(name)}`,
|
const res = await client().client.send(
|
||||||
{},
|
`/api/signup?name=${encodeURIComponent(name)}`,
|
||||||
)
|
{},
|
||||||
instanceInfo.update((info) => ({
|
)
|
||||||
...info,
|
instanceInfo.update((info) => ({
|
||||||
fetching: false,
|
...info,
|
||||||
available: true,
|
fetching: false,
|
||||||
name,
|
available: true,
|
||||||
}))
|
name,
|
||||||
} catch (e) {
|
}))
|
||||||
instanceInfo.update((info) => ({
|
} catch (e) {
|
||||||
...info,
|
instanceInfo.update((info) => ({
|
||||||
fetching: false,
|
...info,
|
||||||
available: false,
|
fetching: false,
|
||||||
name,
|
available: false,
|
||||||
}))
|
name,
|
||||||
}
|
}))
|
||||||
|
}
|
||||||
|
})
|
||||||
})
|
})
|
||||||
|
|
||||||
generateSlug()
|
onMount(() => {
|
||||||
|
generateSlug()
|
||||||
|
})
|
||||||
|
|
||||||
// Set up the variables to hold the form information
|
// Set up the variables to hold the form information
|
||||||
let email: string = ''
|
let email: string = ''
|
||||||
|
Loading…
x
Reference in New Issue
Block a user