Fix FTP URL

This commit is contained in:
Ben Allfree 2022-12-30 22:55:50 -08:00
parent 12b7817bc9
commit 803ef0dd06

View File

@ -1,11 +1,17 @@
<script lang="ts">
import { PUBLIC_APP_DOMAIN } from '$src/env'
import { client } from '$src/pocketbase'
import type { InstanceFields } from '@pockethost/common'
export let instance: InstanceFields
const { user } = client()
const { subdomain } = instance
const ftpUrl = `ftp://${subdomain}.${PUBLIC_APP_DOMAIN}`
const { email } = user() || {}
if (!email) {
throw new Error(`Email expected here`)
}
const ftpUrl = `ftp://${encodeURI(email)}@${PUBLIC_APP_DOMAIN}`
</script>
<div class="py-4">