ec07b4434d
WIP | Use streams to cursor and optimistic updates WIP | Use streamss to whiteboard and optimistic updates WIP | Remove fake delay Add two way batching (server/client client/server) Fix null userId exception and remove logs wip Add two way batching (server/client client/server) for cursor Remove message frequency from draw-listeners component since we handle on message publication Handle clear and undo messages
20 lines
427 B
JavaScript
Executable File
20 lines
427 B
JavaScript
Executable File
import Cursor from '/imports/ui/components/cursor/service';
|
|
import Users from '/imports/api/users';
|
|
|
|
const getCurrentCursor = (cursorId) => {
|
|
const cursor = Cursor.findOne({ _id: cursorId });
|
|
if (cursor) {
|
|
const { userId } = cursor;
|
|
const user = Users.findOne({ userId });
|
|
if (user) {
|
|
cursor.userName = user.name;
|
|
return cursor;
|
|
}
|
|
}
|
|
return false;
|
|
};
|
|
|
|
export default {
|
|
getCurrentCursor,
|
|
};
|