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

use app to check if yjs present

parent 2c58a154
No related branches found
No related tags found
1 merge request!609Standard comments
......@@ -62,7 +62,7 @@ export default class CommentsService extends Service {
this.app.PmPlugins.add(
'commentPlugin',
CommentPlugin('commentPlugin', this.app.context),
CommentPlugin('commentPlugin', this.app),
);
const createOverlay = this.container.get('CreateOverlay');
......
......@@ -6,7 +6,9 @@ import { CommentDecorationPluginKey } from './CommentDecorationPlugin';
const commentPlugin = new PluginKey('commentPlugin');
const getComment = (state, context) => {
const getComment = (state, app) => {
console.log(app.config.get('config.YjsService'));
const { context } = app;
const commentsMap = CommentDecorationPluginKey.getState(state).getMap();
const commentsDataMap = CommentDecorationPluginKey.getState(
state,
......@@ -42,15 +44,15 @@ const getComment = (state, context) => {
return undefined;
};
export default (key, context) => {
export default (key, app) => {
return new Plugin({
key: commentPlugin,
state: {
init: (_, state) => {
return { comment: getComment(state, context) };
return { comment: getComment(state, app) };
},
apply(tr, prev, _, newState) {
const comment = getComment(newState, context);
const comment = getComment(newState, app);
let createDecoration;
if (comment) {
createDecoration = DecorationSet.create(newState.doc, [
......
......@@ -164,7 +164,6 @@ const BlockDropDownComponent = ({ view, tools }) => {
}, [isDisabled]);
useEffect(() => {
console.log('here?');
setLabel(translatedLabel('Wax.BlockLevel.Block Level', 'Styles'));
let delayedSetLabel = () => true;
dropDownOptions.forEach(option => {
......
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