Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import { sdpExchangeServerBase } from '../../../api';

let currentState = $state<
'init' | 'connected' | 'sending' | 'done' | 'error-user-denied' | 'error'
'init' | 'connected' | 'text-transferred' | 'sending' | 'error-user-denied' | 'error'
>('init');
let textInput: HTMLInputElement;
let sendTextToForm = $state<() => void>();
Expand All @@ -23,11 +23,8 @@
flottformTextInputClient.on('connected', () => {
currentState = 'connected';
});
flottformTextInputClient.on('sending', () => {
currentState = 'sending';
});
flottformTextInputClient.on('done', () => {
currentState = 'done';
flottformTextInputClient.on('text-transferred', () => {
currentState = 'text-transferred';
});
flottformTextInputClient.on('error', () => {
currentState = 'error';
Expand Down Expand Up @@ -67,7 +64,7 @@
<circle cx="50" cy="50" r="45" class="spinner" />
</svg>
</div>
{:else if currentState === 'done'}
{:else if currentState === 'text-transferred'}
<div class="flex gap-6">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32" version="1.1" class="w-12">
<path
Expand Down
4 changes: 2 additions & 2 deletions servers/where-are-you-at/src/routes/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import { browser } from '$app/environment';
import { onMount } from 'svelte';
import { writable } from 'svelte/store';
import ShowLocation from './ShowLocation.svelte';
import { sdpExchangeServerBase } from '$lib/api';
import { base } from '$app/paths';
import ShowLocation from './ShowLocation.svelte';

type Coordinates = {
accuracy: number;
Expand Down Expand Up @@ -52,7 +52,7 @@
flottformTextInputHost.on('connected', () => {
$currentState = 'connected';
});
flottformTextInputHost.on('done', (message: string) => {
flottformTextInputHost.on('text-received', (message: string) => {
$currentState = 'done';
const coords: Coordinates = JSON.parse(message);
$latitude = coords.latitude;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@
flottformTextInputClient.on('connected', () => {
currentState = 'connected';
});
flottformTextInputClient.on('sending', () => {
currentState = 'sending';
});
flottformTextInputClient.on('done', () => {
flottformTextInputClient.on('text-transferred', () => {
currentState = 'done';
});
flottformTextInputClient.on('error', () => {
Expand Down