chore: Auto reload frontend of client is out of date (#1270)

* Move editor version to header
Add editor version check for API endpoints

* fix: Editor update auto-reload
Bump RME

* fix: Only redirect if editor header exists

* lint
This commit is contained in:
Tom Moor
2020-05-16 14:05:51 -07:00
committed by GitHub
parent 82749ffbd8
commit e0b33ee576
6 changed files with 36 additions and 5 deletions

View File

@@ -1,6 +1,5 @@
// @flow
import { action, set, observable, computed } from 'mobx';
import pkg from 'rich-markdown-editor/package.json';
import addDays from 'date-fns/add_days';
import invariant from 'invariant';
import { client } from 'utils/ApiClient';
@@ -180,7 +179,6 @@ export default class Document extends BaseModel {
try {
if (isCreating) {
return await this.store.create({
editorVersion: pkg.version,
parentDocumentId: this.parentDocumentId,
collectionId: this.collectionId,
title: this.title,
@@ -194,7 +192,6 @@ export default class Document extends BaseModel {
title: this.title,
text: this.text,
lastRevision: this.revision,
editorVersion: pkg.version,
...options,
});
} finally {