Creation meta is now omitted when no user present
This commit is contained in:
parent
b20ff30433
commit
9e4f0bd3f3
|
@ -68,10 +68,13 @@ const Editor = props => {
|
||||||
const creationMeta = body => {
|
const creationMeta = body => {
|
||||||
const meta = {};
|
const meta = {};
|
||||||
|
|
||||||
// No point in adding meta while we're in draft state
|
const { user } = Environment;
|
||||||
if (!body.draft) {
|
|
||||||
const { user } = Environment;
|
// Metadata is only added when a user is set, otherwise
|
||||||
if (user) meta.creator = {};
|
// 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.id) meta.creator.id = user.id;
|
||||||
if (user.displayName) meta.creator.name = user.displayName;
|
if (user.displayName) meta.creator.name = user.displayName;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue