Skip to content
Snippets Groups Projects
Commit e0b04439 authored by chris's avatar chris
Browse files

map position

parent 54c13f7d
No related branches found
No related tags found
No related merge requests found
Pipeline #60020 passed with stages
in 3 minutes and 21 seconds
......@@ -36,21 +36,24 @@ const CommentBubbleComponent = ({ setPosition, position, group }) => {
event.preventDefault();
const { selection } = state;
if (context.app.config.get('config.YjsService')) {
return createYjsComments(selection);
}
// if (context.app.config.get('config.YjsService')) {
// return createYjsComments(selection);
// }
const fromPos = state.tr.mapping.map(selection.from);
const toPos = state.tr.mapping.map(selection.to);
dispatch(
state.tr.setMeta(CommentDecorationPluginKey, {
type: 'addComment',
from: selection.from,
to: selection.to,
from: fromPos,
to: toPos,
data: {
type: 'comment',
yjsFrom: selection.from,
yjsTo: selection.to,
pmFrom: selection.from,
pmTo: selection.to,
yjsFrom: fromPos,
yjsTo: toPos,
pmFrom: fromPos,
pmTo: toPos,
conversation: [],
title: '',
group,
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment