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 ScrollOverlay from "./ScrollOverlay.svelte"
import StickyColumn from "./StickyColumn.svelte" import StickyColumn from "./StickyColumn.svelte"
import UserAvatars from "./UserAvatars.svelte" import UserAvatars from "./UserAvatars.svelte"
import RowCount from "./RowCount.svelte"
export let API export let API
export let tableId export let tableId

View File

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

View File

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