Skip to content

Commit

Permalink
fix: make the original demo use the correct client
Browse files Browse the repository at this point in the history
Signed-off-by: nidhal-labidi <[email protected]>
  • Loading branch information
nidhal-labidi committed Aug 26, 2024
1 parent fdcad87 commit 9007a5b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
5 changes: 2 additions & 3 deletions flottform/demo/src/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@ import { env } from '$env/dynamic/public';
export const sdpExchangeServerBase =
env.PUBLIC_FLOTTFORM_SERVER_BASE || 'https://192.168.0.21:5177/flottform';

const clientBase =
env.PUBLIC_FLOTTFORM_CLIENT_BASE || 'https://192.168.0.21:5173/multiple-input-form-client';
const clientBase = env.PUBLIC_FLOTTFORM_CLIENT_BASE || 'https://192.168.0.21:5173/flottform-client';

export const createClientUrl = async ({ endpointId }: { endpointId: string }) => {
if (browser) {
return `${window.location.origin}${base}/multiple-input-form-client/${endpointId}`;
return `${window.location.origin}${base}/flottform-client/${endpointId}`;
}
return `${clientBase}/${endpointId}`;
};
15 changes: 14 additions & 1 deletion flottform/demo/src/routes/multiple-input-form/+page.svelte
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
<script lang="ts">
import { FlottformFileInputHost, defaultThemeForFileInput } from '@flottform/forms';
import { onMount } from 'svelte';
import { createClientUrl, sdpExchangeServerBase } from '../../api';
import { browser } from '$app/environment';
import { env } from '$env/dynamic/public';
import { base } from '$app/paths';
import { sdpExchangeServerBase } from '../../api';
const clientBase =
env.PUBLIC_FLOTTFORM_CLIENT_BASE || 'https://192.168.0.21:5177/multiple-input-form-client';
export const createClientUrl = async ({ endpointId }: { endpointId: string }) => {
if (browser) {
return `${window.location.origin}${base}/multiple-input-form-client/${endpointId}`;
}
return `${clientBase}/${endpointId}`;
};
onMount(async () => {
const fileInputs = document.querySelectorAll(
Expand Down

0 comments on commit 9007a5b

Please sign in to comment.