From 8f1f90c3e7d836a23f1cd09617c2a0fcfac3f3f4 Mon Sep 17 00:00:00 2001
From: Melonai <einebeere@gmail.com>
Date: Mon, 31 May 2021 01:47:38 +0200
Subject: Socket connection with managed state

---
 assets/src/components/Request.svelte | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

(limited to 'assets/src/components/Request.svelte')

diff --git a/assets/src/components/Request.svelte b/assets/src/components/Request.svelte
index 134c4d5..0c0b111 100644
--- a/assets/src/components/Request.svelte
+++ b/assets/src/components/Request.svelte
@@ -1,13 +1,9 @@
 <script lang="ts">
-    import { getToken, joinRequestChannel } from "../network/socket";
-    import getShareToken from "../utils/getShareToken";
+    import { start, Type } from "../network/channel/connection";
 
-    const startConnection = async () => {
-        const token = await getToken();
-        joinRequestChannel(token, getShareToken());
-    };
+    // TODO: Switch to store-based state updates.
 
-    startConnection();
+    start(Type.REQUEST);
 </script>
 
 <main>
-- 
cgit 1.4.1

