fix: Do not copy edit path from headers

chore: Rename url -> path in routeHelpers
closes #5229
This commit is contained in:
Tom Moor
2023-04-22 10:00:09 -04:00
parent 4b5680a16e
commit e2c5fda610
19 changed files with 91 additions and 80 deletions

View File

@@ -39,9 +39,9 @@ import { emojiToUrl } from "~/utils/emoji";
import { isModKey } from "~/utils/keyboard";
import {
documentHistoryUrl,
editDocumentUrl,
updateDocumentUrl,
documentHistoryPath,
documentEditPath,
updateDocumentPath,
} from "~/utils/routeHelpers";
import Container from "./Container";
import Contents from "./Contents";
@@ -211,7 +211,7 @@ class DocumentScene extends React.Component<Props> {
const { document, abilities } = this.props;
if (abilities.update) {
this.props.history.push(editDocumentUrl(document));
this.props.history.push(documentEditPath(document));
}
};
@@ -228,7 +228,7 @@ class DocumentScene extends React.Component<Props> {
if (location.pathname.endsWith("history")) {
this.props.history.push(document.url);
} else {
this.props.history.push(documentHistoryUrl(document));
this.props.history.push(documentHistoryPath(document));
}
};
@@ -307,7 +307,7 @@ class DocumentScene extends React.Component<Props> {
this.props.history.push(savedDocument.url);
this.props.ui.setActiveDocument(savedDocument);
} else if (document.isNew) {
this.props.history.push(editDocumentUrl(savedDocument));
this.props.history.push(documentEditPath(savedDocument));
this.props.ui.setActiveDocument(savedDocument);
}
} catch (err) {
@@ -399,7 +399,7 @@ class DocumentScene extends React.Component<Props> {
const canonicalUrl = shareId
? this.props.match.url
: updateDocumentUrl(this.props.match.url, document);
: updateDocumentPath(this.props.match.url, document);
return (
<ErrorBoundary showTitle>