From 23a2c7a052b7a8f631f75a582a9885d0e8a29396 Mon Sep 17 00:00:00 2001 From: Jori Lallo Date: Sun, 10 Sep 2017 13:05:54 -0400 Subject: [PATCH] added a comment + more reliable edit cancel --- frontend/scenes/Document/Document.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/scenes/Document/Document.js b/frontend/scenes/Document/Document.js index b125a9e8c..a824f4367 100644 --- a/frontend/scenes/Document/Document.js +++ b/frontend/scenes/Document/Document.js @@ -91,6 +91,7 @@ type Props = { this.props.ui.setActiveDocument(document); document.view(); } else { + // Render 404 with search this.setState({ notFound: true }); } } @@ -147,7 +148,8 @@ type Props = { }; onCancel = () => { - this.props.history.goBack(); + if (!this.document) return; + this.props.history.push(this.document.url); }; onStartDragging = () => {