Update layout and remove logging
This commit is contained in:
parent
4647e1bc07
commit
d15b1748ef
|
@ -0,0 +1,9 @@
|
|||
<script>
|
||||
import { getContext } from "svelte"
|
||||
|
||||
const { rows } = getContext("sheet")
|
||||
</script>
|
||||
|
||||
<div>
|
||||
{$rows.length} row{$rows.length === 1 ? "" : "s"}
|
||||
</div>
|
|
@ -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
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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)
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue