small refactor, lint and fixes
This commit is contained in:
@@ -8,7 +8,12 @@ import { withRouter, Prompt } from 'react-router';
|
||||
import keydown from 'react-keydown';
|
||||
import Flex from 'components/Flex';
|
||||
import { color, layout } from 'styles/constants';
|
||||
import { collectionUrl, updateDocumentUrl } from 'utils/routeHelpers';
|
||||
import {
|
||||
collectionUrl,
|
||||
updateDocumentUrl,
|
||||
matchDocumentEdit,
|
||||
matchDocumentMove,
|
||||
} from 'utils/routeHelpers';
|
||||
|
||||
import Document from 'models/Document';
|
||||
import DocumentMove from './components/DocumentMove';
|
||||
@@ -25,8 +30,6 @@ import CenteredContent from 'components/CenteredContent';
|
||||
import PageTitle from 'components/PageTitle';
|
||||
import Search from 'scenes/Search';
|
||||
|
||||
import { matchDocumentEdit, matchDocumentMove } from 'utils/routeHelpers';
|
||||
|
||||
const DISCARD_CHANGES = `
|
||||
You have unsaved changes.
|
||||
Are you sure you want to discard them?
|
||||
@@ -80,7 +83,7 @@ type Props = {
|
||||
@keydown('m')
|
||||
goToMove(event) {
|
||||
event.preventDefault();
|
||||
this.props.history.push(`${this.document.url}/move`);
|
||||
if (this.document) this.props.history.push(`${this.document.url}/move`);
|
||||
}
|
||||
|
||||
loadDocument = async props => {
|
||||
|
||||
Reference in New Issue
Block a user