Linting [ci skip]
This commit is contained in:
@ -169,7 +169,7 @@ class DocumentScene extends React.Component<Props> {
|
|||||||
// prevent autosave if nothing has changed
|
// prevent autosave if nothing has changed
|
||||||
if (options.autosave && document.text.trim() === text.trim()) return;
|
if (options.autosave && document.text.trim() === text.trim()) return;
|
||||||
|
|
||||||
document.updateData({ text }, true);
|
document.updateData({ text });
|
||||||
if (!document.allowSave) return;
|
if (!document.allowSave) return;
|
||||||
|
|
||||||
// prevent autosave before anything has been written
|
// prevent autosave before anything has been written
|
||||||
@ -197,7 +197,10 @@ class DocumentScene extends React.Component<Props> {
|
|||||||
}, AUTOSAVE_DELAY);
|
}, AUTOSAVE_DELAY);
|
||||||
|
|
||||||
updateIsDirty = debounce(() => {
|
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);
|
}, IS_DIRTY_DELAY);
|
||||||
|
|
||||||
onImageUploadStart = () => {
|
onImageUploadStart = () => {
|
||||||
|
@ -12,8 +12,8 @@ import styled from 'styled-components';
|
|||||||
import Modal from 'components/Modal';
|
import Modal from 'components/Modal';
|
||||||
import Input from 'components/Input';
|
import Input from 'components/Input';
|
||||||
import Labeled from 'components/Labeled';
|
import Labeled from 'components/Labeled';
|
||||||
|
import PathToDocument from 'components/PathToDocument';
|
||||||
import Flex from 'shared/components/Flex';
|
import Flex from 'shared/components/Flex';
|
||||||
import PathToDocument from './components/PathToDocument';
|
|
||||||
|
|
||||||
import Document from 'models/Document';
|
import Document from 'models/Document';
|
||||||
import DocumentsStore from 'stores/DocumentsStore';
|
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 = {
|
type Props = {
|
||||||
titlePlaceholder: string,
|
titlePlaceholder: string,
|
||||||
bodyPlaceholder: string,
|
bodyPlaceholder: string,
|
||||||
|
defaultValue?: string,
|
||||||
readOnly: boolean,
|
readOnly: boolean,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -128,6 +128,7 @@ class DocumentsStore extends BaseStore {
|
|||||||
const data = await this.fetchPage('list', options);
|
const data = await this.fetchPage('list', options);
|
||||||
|
|
||||||
runInAction('DocumentsStore#fetchRecentlyEdited', () => {
|
runInAction('DocumentsStore#fetchRecentlyEdited', () => {
|
||||||
|
// $FlowFixMe
|
||||||
this.recentlyEditedIds.replace(
|
this.recentlyEditedIds.replace(
|
||||||
uniq(this.recentlyEditedIds.concat(map(data, 'id')))
|
uniq(this.recentlyEditedIds.concat(map(data, 'id')))
|
||||||
);
|
);
|
||||||
@ -140,6 +141,7 @@ class DocumentsStore extends BaseStore {
|
|||||||
const data = await this.fetchPage('viewed', options);
|
const data = await this.fetchPage('viewed', options);
|
||||||
|
|
||||||
runInAction('DocumentsStore#fetchRecentlyViewed', () => {
|
runInAction('DocumentsStore#fetchRecentlyViewed', () => {
|
||||||
|
// $FlowFixMe
|
||||||
this.recentlyViewedIds.replace(
|
this.recentlyViewedIds.replace(
|
||||||
uniq(this.recentlyViewedIds.concat(map(data, 'id')))
|
uniq(this.recentlyViewedIds.concat(map(data, 'id')))
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user