From 077a38dc22f6082974e639f8a020ceb179116958 Mon Sep 17 00:00:00 2001 From: bobzel Date: Fri, 14 Aug 2020 18:08:47 -0400 Subject: fixed some edge cses with richTextMenu synchronization. added author field to delegates --- src/client/views/collections/CollectionMenu.tsx | 4 +++- src/client/views/nodes/formattedText/RichTextMenu.tsx | 2 +- src/fields/Doc.ts | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/client/views/collections/CollectionMenu.tsx b/src/client/views/collections/CollectionMenu.tsx index 0b3be8739..97d38d27e 100644 --- a/src/client/views/collections/CollectionMenu.tsx +++ b/src/client/views/collections/CollectionMenu.tsx @@ -429,7 +429,9 @@ export class CollectionFreeFormViewChrome extends React.Component { @action public updateMenu(view: EditorView, lastState: EditorState | undefined, props: any) { - if (!view || !(view as any).TextView?.props.isSelected(true)) { + if (!view || !(view as any).TextView?.props.isSelected(true) || !view.hasFocus()) { return; } this.view = view; diff --git a/src/fields/Doc.ts b/src/fields/Doc.ts index ea53bc9a2..b530b1cf7 100644 --- a/src/fields/Doc.ts +++ b/src/fields/Doc.ts @@ -781,6 +781,7 @@ export namespace Doc { if (doc) { const delegate = new Doc(id, true); delegate.proto = doc; + delegate.author = Doc.CurrentUserEmail; title && (delegate.title = title); return delegate; } -- cgit v1.2.3-70-g09d2