From 9e4f0bd3f3b8dbebf7d898fd583bdfa102e3a283 Mon Sep 17 00:00:00 2001 From: Rainer Simon Date: Mon, 18 May 2020 09:42:55 +0200 Subject: [PATCH] Creation meta is now omitted when no user present --- src/editor/Editor.jsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/editor/Editor.jsx b/src/editor/Editor.jsx index 0524209..09a53ea 100644 --- a/src/editor/Editor.jsx +++ b/src/editor/Editor.jsx @@ -68,10 +68,13 @@ const Editor = props => { const creationMeta = body => { const meta = {}; - // No point in adding meta while we're in draft state - if (!body.draft) { - const { user } = Environment; - if (user) meta.creator = {}; + const { user } = Environment; + + // Metadata is only added when a user is set, otherwise + // the Editor operates in 'anonymous mode'. Also, + // no point in adding meta while we're in draft state + if (!body.draft && user) { + meta.creator = {}; if (user.id) meta.creator.id = user.id; if (user.displayName) meta.creator.name = user.displayName;