Skip to content

Commit 61d3e4a

Browse files
committed
Fix EasyConnect - in the last UI refactor EasyConnect for Host was
broken
1 parent b3c6f29 commit 61d3e4a

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

frontend/src/routes/mode/EasyConnect.svelte

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,21 @@
33
easyConnectServerIpDomain,
44
easyConnectID,
55
handleEasyConnectClient,
6+
handleEasyConnectHost,
67
DEFAULT_EASY_CONNECT_ID,
78
DEFAULT_EASY_CONNECT_SERVER_IP_DOMAIN
89
} from '$lib/easy_connect/easy_connect.svelte';
910
1011
import { _ } from 'svelte-i18n';
1112
import { onMount } from 'svelte';
1213
14+
const { role }: {role: "CLIENT" | "HOST"} = $props()
15+
1316
onMount(() => {
1417
easyConnectID.value = DEFAULT_EASY_CONNECT_ID;
1518
easyConnectServerIpDomain.value = DEFAULT_EASY_CONNECT_SERVER_IP_DOMAIN;
1619
});
17-
20+
1821
</script>
1922

2023
<section
@@ -66,9 +69,15 @@
6669
/>
6770
</div>
6871

69-
<button onclick={handleEasyConnectClient} class="btn btn-primary"
70-
>{$_('connect-to-host')}</button
71-
>
72+
{#if role === "CLIENT"}
73+
<button onclick={handleEasyConnectClient} class="btn btn-primary"
74+
>{$_('connect-to-host')}</button>
75+
{:else}
76+
<button onclick={handleEasyConnectHost} class="btn btn-primary"
77+
>{$_('connect-to-client')}</button>
78+
{/if}
79+
80+
7281
</section>
7382
</li>
7483
</ol>

frontend/src/routes/mode/client/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
</div>
7474

7575
<div class="mt-0 grid md:grid-cols-5 gap-4 card rounded-lg shadow-xl border border-gray-800 p-2">
76-
<EasyConnect />
76+
<EasyConnect role="CLIENT"/>
7777
<section class="md:col-span-2 md:pt-8 card border rounded-lg shadow-xl bg-white border-gray-700">
7878
<div class="card-body">
7979
<section class="flex flex-col md:flex-row [&>ol]:px-4">

frontend/src/routes/mode/host/+page.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
</div>
7474

7575
<div class="mt-0 grid md:grid-cols-5 gap-4 card rounded-lg shadow-xl border border-gray-800 p-2">
76-
<EasyConnect />
76+
<EasyConnect role="HOST"/>
7777
<section class="md:col-span-2 md:pt-8 card border rounded-lg shadow-xl bg-white border-gray-700">
7878
<div class="card-body">
7979
<section class="flex flex-col md:flex-row [&>ol]:px-4">

0 commit comments

Comments
 (0)