Skip to content

Commit

Permalink
fix: removed @cocreate/message-client
Browse files Browse the repository at this point in the history
  • Loading branch information
frankpagan committed Oct 19, 2023
1 parent e655b69 commit 50548ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@
},
"dependencies": {
"@cocreate/local-storage": "^1.10.5",
"@cocreate/message-client": "^1.8.3",
"@cocreate/observer": "^1.11.5",
"@cocreate/random-color": "^1.7.2",
"@cocreate/selection": "^1.9.4",
"@cocreate/socket-client": "^1.31.0",
"@cocreate/utils": "^1.25.3",
"@cocreate/uuid": "^1.7.2"
}
Expand Down
14 changes: 7 additions & 7 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@
/*globals ResizeObserver*/
import observer from '@cocreate/observer';
import { getAttributeNames } from '@cocreate/utils';
import message from '@cocreate/message-client';
import socket from '@cocreate/socket-client';
import uuid from '@cocreate/uuid';
import localStorage from '@cocreate/local-storage';
import { getElementPosition } from '@cocreate/selection';
import { randomColor } from '@cocreate/random-color';
import './index.css';

const clientId = message.socket.clientId || uuid.generate(12);
const clientId = socket.clientId || uuid.generate(12);
const cursorBackground = randomColor();

let environment_prod = true;
Expand Down Expand Up @@ -92,7 +92,7 @@ function drawCursors(selection) {
elements = document.querySelectorAll(selector);
}
for (let element of elements) {
if (window.activeElement == element && message.socket.has(selection.socketId)) {
if (window.activeElement == element && socket.has(selection.socketId)) {
continue;
}
let realtime = element.getAttribute('realtime');
Expand Down Expand Up @@ -342,8 +342,8 @@ function initResizeObserver(element) {

function sendPosition(info) {
try {
message.send({
message: "cursor",
socket.send({
method: "cursor",
data: {
array: info.array,
object: info.object,
Expand All @@ -364,8 +364,8 @@ function sendPosition(info) {
}


message.listen('cursor', function (response) {
// if (message.socket.has(selection.socketId)) return;
socket.listen('cursor', function (response) {
// if (socket.has(selection.socketId)) return;
let selection = response.data
selection.socketId = response.socketId
if (selection.start != null && selection.end != null)
Expand Down

0 comments on commit 50548ed

Please sign in to comment.