Update layout and remove logging

This commit is contained in:
Andrew Kingston 2023-03-06 11:30:38 +00:00
parent 4647e1bc07
commit d15b1748ef
4 changed files with 11 additions and 11 deletions

View File

@ -0,0 +1,9 @@
<script>
import { getContext } from "svelte"
const { rows } = getContext("sheet")
</script>
<div>
{$rows.length} row{$rows.length === 1 ? "" : "s"}
</div>

View File

@ -19,6 +19,7 @@
import ScrollOverlay from "./ScrollOverlay.svelte"
import StickyColumn from "./StickyColumn.svelte"
import UserAvatars from "./UserAvatars.svelte"
import RowCount from "./RowCount.svelte"
export let API
export let tableId

View File

@ -19,7 +19,6 @@
const getStyle = (width, selectedUser) => {
let style = `flex: 0 0 ${width}px;`
if (selectedUser) {
console.log(selectedUser)
style += `--user-color:${selectedUser.color};`
}
return style
@ -47,7 +46,7 @@
<slot />
{#if selectedUser && !selected}
<div class="user">
{selectedUser.label} wwwwwwwwwwwwwwwwwwwwaaaaaa
{selectedUser.label}
</div>
{/if}
</div>

View File

@ -25,8 +25,6 @@ export const createWebsocket = context => {
if (!socket.connected) {
return
}
console.log("Identifying dataspace", tableId)
// Identify which dataspace we are editing
socket.emit("select-dataspace", tableId, response => {
// handle initial connection info
@ -39,24 +37,17 @@ export const createWebsocket = context => {
socket.on("connect", () => {
connectToDataspace(get(tableId))
})
socket.on("row-update", data => {
console.log("row-update", data.id)
if (data.id) {
rows.actions.refreshRow(data.id)
}
})
socket.on("user-update", user => {
console.log("user-update", user.id)
users.actions.updateUser(user)
})
socket.on("user-disconnect", user => {
console.log("user-disconnect", user.id)
users.actions.removeUser(user)
})
socket.on("connect_error", err => {
console.log("Failed to connect to websocket:", err.message)
})