Linting [ci skip]

This commit is contained in:
Tom Moor
2018-08-26 15:27:32 -07:00
parent 328f731541
commit 54a04dd8cc
6 changed files with 9 additions and 6 deletions

View File

@ -169,7 +169,7 @@ class DocumentScene extends React.Component<Props> {
// prevent autosave if nothing has changed
if (options.autosave && document.text.trim() === text.trim()) return;
document.updateData({ text }, true);
document.updateData({ text });
if (!document.allowSave) return;
// prevent autosave before anything has been written
@ -197,7 +197,10 @@ class DocumentScene extends React.Component<Props> {
}, AUTOSAVE_DELAY);
updateIsDirty = debounce(() => {
this.isDirty = this.getEditorText().trim() !== this.document.text.trim();
const document = this.document;
this.isDirty =
document && this.getEditorText().trim() !== document.text.trim();
}, IS_DIRTY_DELAY);
onImageUploadStart = () => {

View File

@ -12,8 +12,8 @@ import styled from 'styled-components';
import Modal from 'components/Modal';
import Input from 'components/Input';
import Labeled from 'components/Labeled';
import PathToDocument from 'components/PathToDocument';
import Flex from 'shared/components/Flex';
import PathToDocument from './components/PathToDocument';
import Document from 'models/Document';
import DocumentsStore from 'stores/DocumentsStore';

View File

@ -1,3 +0,0 @@
// @flow
import DocumentMove from './DocumentMove';
export default DocumentMove;

View File

@ -8,6 +8,7 @@ import ClickablePadding from 'components/ClickablePadding';
type Props = {
titlePlaceholder: string,
bodyPlaceholder: string,
defaultValue?: string,
readOnly: boolean,
};

View File

@ -128,6 +128,7 @@ class DocumentsStore extends BaseStore {
const data = await this.fetchPage('list', options);
runInAction('DocumentsStore#fetchRecentlyEdited', () => {
// $FlowFixMe
this.recentlyEditedIds.replace(
uniq(this.recentlyEditedIds.concat(map(data, 'id')))
);
@ -140,6 +141,7 @@ class DocumentsStore extends BaseStore {
const data = await this.fetchPage('viewed', options);
runInAction('DocumentsStore#fetchRecentlyViewed', () => {
// $FlowFixMe
this.recentlyViewedIds.replace(
uniq(this.recentlyViewedIds.concat(map(data, 'id')))
);