From bf1450799df0deb424a9675be89e13c29e3620d7 Mon Sep 17 00:00:00 2001
From: Mel <einebeere@gmail.com>
Date: Sat, 19 Feb 2022 20:00:38 +0100
Subject: Split state into stages to handle messages

---
 assets/src/components/share/DataSelector.svelte | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

(limited to 'assets/src/components/share/DataSelector.svelte')

diff --git a/assets/src/components/share/DataSelector.svelte b/assets/src/components/share/DataSelector.svelte
index 6838a05..965d0a1 100644
--- a/assets/src/components/share/DataSelector.svelte
+++ b/assets/src/components/share/DataSelector.svelte
@@ -1,13 +1,11 @@
 <script lang="ts">
-    import { startShareConnection } from "../../network/channel/share_connection";
-
-    import data from "../../stores/data";
+    import { ChoosingData, getShareState } from "../../state/share";
 
     let value = "";
 
     const submit = () => {
-        data.set(value);
-        startShareConnection();
+        const share = getShareState().state as ChoosingData;
+        share.submitData(value);
     };
 
     // TODO: Accept data other than text.
-- 
cgit 1.4.1

