Linting [ci skip]
This commit is contained in:
@ -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 = () => {
|
||||
|
@ -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';
|
@ -1,3 +0,0 @@
|
||||
// @flow
|
||||
import DocumentMove from './DocumentMove';
|
||||
export default DocumentMove;
|
@ -8,6 +8,7 @@ import ClickablePadding from 'components/ClickablePadding';
|
||||
type Props = {
|
||||
titlePlaceholder: string,
|
||||
bodyPlaceholder: string,
|
||||
defaultValue?: string,
|
||||
readOnly: boolean,
|
||||
};
|
||||
|
||||
|
@ -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')))
|
||||
);
|
||||
|
Reference in New Issue
Block a user