wip adding web socket with nest
This commit is contained in:
@@ -13,17 +13,27 @@
|
||||
import MuteLayout from './Layout_mute.svelte';
|
||||
import UserLayout from './Layout_user.svelte';
|
||||
|
||||
/* web sockets with socket.io
|
||||
*/
|
||||
import { onMount } from 'svelte';
|
||||
import io from 'socket.io-client';
|
||||
const socket = io('http://transcendance:8080/api/v2');
|
||||
onMount(async => {
|
||||
socket.on('connect', () => {
|
||||
console.log("client connection");
|
||||
});
|
||||
});
|
||||
|
||||
/* global variables
|
||||
*/
|
||||
export let color = "transparent";
|
||||
|
||||
let room = "";
|
||||
let admin = false;
|
||||
let layout = "close";
|
||||
let layouts = ["home", "home"];
|
||||
|
||||
// hold previous version of layout, to go back
|
||||
/* hold previous version of layout, to go back
|
||||
*/
|
||||
function set_layouts(layout)
|
||||
{
|
||||
if (layout === "close")
|
||||
@@ -34,7 +44,6 @@
|
||||
layouts = [layout, "home"];
|
||||
else
|
||||
layouts = [layout, layouts[0]];
|
||||
console.log(layouts);
|
||||
}
|
||||
$: set_layouts(layout);
|
||||
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
function update_layout() {
|
||||
layout = new_layout;
|
||||
console.log(layout);
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -22,7 +22,6 @@
|
||||
function send_msg()
|
||||
{
|
||||
msg = msg.trim();
|
||||
console.log(msg);
|
||||
|
||||
if (msg.length > 0) {
|
||||
//socket.emit('sendmsg', msg);
|
||||
|
||||
Reference in New Issue
Block a user