From e2bf02841f4d7128be28c2ffa51431e149dcd5e7 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Thu, 19 May 2022 14:36:49 +0200 Subject: [PATCH] fix: Demo instance save domain instantly --- src/routes/applications/[id]/index.svelte | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/routes/applications/[id]/index.svelte b/src/routes/applications/[id]/index.svelte index 6b3d09dd7..a00f08d2f 100644 --- a/src/routes/applications/[id]/index.svelte +++ b/src/routes/applications/[id]/index.svelte @@ -88,9 +88,7 @@ function containerClass() { return 'text-white border border-dashed border-coolgray-300 bg-transparent font-thin px-0'; } - if (browser && window.location.hostname === 'demo.coolify.io' && !application.fqdn) { - application.fqdn = `http://${cuid()}.demo.coolify.io`; - } + async function getUsage() { if (usageLoading) return; usageLoading = true; @@ -102,6 +100,10 @@ clearInterval(usageInterval); }); onMount(async () => { + if (browser && window.location.hostname === 'demo.coolify.io' && !application.fqdn) { + application.fqdn = `http://${cuid()}.demo.coolify.io`; + await handleSubmit(); + } domainEl.focus(); await getUsage(); usageInterval = setInterval(async () => { @@ -149,6 +151,7 @@ } } async function handleSubmit() { + if (loading) return; loading = true; try { nonWWWDomain = application.fqdn && getDomain(application.fqdn).replace(/^www\./, '');