Fixes: Redirects do not push into history stack
This commit is contained in:
@ -77,7 +77,7 @@ class DropToImport extends React.Component<Props> {
|
|||||||
...rest
|
...rest
|
||||||
} = this.props;
|
} = this.props;
|
||||||
|
|
||||||
if (this.redirectTo) return <Redirect to={this.redirectTo} />;
|
if (this.redirectTo) return <Redirect to={this.redirectTo} push />;
|
||||||
if (this.props.disabled) return this.props.children;
|
if (this.props.disabled) return this.props.children;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -74,7 +74,7 @@ class Editor extends React.Component<Props> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.redirectTo) return <Redirect to={this.redirectTo} />;
|
if (this.redirectTo) return <Redirect to={this.redirectTo} push />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<RichMarkdownEditor
|
<RichMarkdownEditor
|
||||||
|
@ -81,7 +81,7 @@ class Layout extends React.Component<Props> {
|
|||||||
const showSidebar = auth.authenticated && user && team;
|
const showSidebar = auth.authenticated && user && team;
|
||||||
|
|
||||||
if (auth.isSuspended) return <ErrorSuspended />;
|
if (auth.isSuspended) return <ErrorSuspended />;
|
||||||
if (this.redirectTo) return <Redirect to={this.redirectTo} />;
|
if (this.redirectTo) return <Redirect to={this.redirectTo} push />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Container column auto>
|
<Container column auto>
|
||||||
|
@ -41,7 +41,7 @@ class AccountMenu extends React.Component<Props> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.redirectTo) return <Redirect to={this.redirectTo} />;
|
if (this.redirectTo) return <Redirect to={this.redirectTo} push />;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DropdownMenu
|
<DropdownMenu
|
||||||
|
@ -90,7 +90,7 @@ class CollectionMenu extends React.Component<Props> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.redirectTo) return <Redirect to={this.redirectTo} />;
|
if (this.redirectTo) return <Redirect to={this.redirectTo} push />;
|
||||||
|
|
||||||
const { collection, label, onOpen, onClose } = this.props;
|
const { collection, label, onOpen, onClose } = this.props;
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ class DocumentMenu extends React.Component<Props> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.redirectTo) return <Redirect to={this.redirectTo} />;
|
if (this.redirectTo) return <Redirect to={this.redirectTo} push />;
|
||||||
|
|
||||||
const { document, label, className, showPrint, auth } = this.props;
|
const { document, label, className, showPrint, auth } = this.props;
|
||||||
const canShareDocuments = auth.team && auth.team.sharing;
|
const canShareDocuments = auth.team && auth.team.sharing;
|
||||||
|
@ -34,7 +34,7 @@ class NewChildDocumentMenu extends React.Component<Props> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.redirectTo) return <Redirect to={this.redirectTo} />;
|
if (this.redirectTo) return <Redirect to={this.redirectTo} push />;
|
||||||
|
|
||||||
const { label, document, ...rest } = this.props;
|
const { label, document, ...rest } = this.props;
|
||||||
const { collection } = document;
|
const { collection } = document;
|
||||||
|
@ -35,7 +35,7 @@ class NewDocumentMenu extends React.Component<Props> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.redirectTo) return <Redirect to={this.redirectTo} />;
|
if (this.redirectTo) return <Redirect to={this.redirectTo} push />;
|
||||||
|
|
||||||
const { collections, label, ...rest } = this.props;
|
const { collections, label, ...rest } = this.props;
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ class ShareMenu extends React.Component<Props> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.redirectTo) return <Redirect to={this.redirectTo} />;
|
if (this.redirectTo) return <Redirect to={this.redirectTo} push />;
|
||||||
|
|
||||||
const { share, label, onOpen, onClose } = this.props;
|
const { share, label, onOpen, onClose } = this.props;
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ class CollectionScene extends React.Component<Props> {
|
|||||||
render() {
|
render() {
|
||||||
const { documents } = this.props;
|
const { documents } = this.props;
|
||||||
|
|
||||||
if (this.redirectTo) return <Redirect to={this.redirectTo} />;
|
if (this.redirectTo) return <Redirect to={this.redirectTo} push />;
|
||||||
if (!this.isFetching && !this.collection) return <Search notFound />;
|
if (!this.isFetching && !this.collection) return <Search notFound />;
|
||||||
|
|
||||||
const pinnedDocuments = this.collection
|
const pinnedDocuments = this.collection
|
||||||
|
@ -87,7 +87,7 @@ class Header extends React.Component<Props> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
if (this.redirectTo) return <Redirect to={this.redirectTo} />;
|
if (this.redirectTo) return <Redirect to={this.redirectTo} push />;
|
||||||
|
|
||||||
const {
|
const {
|
||||||
document,
|
document,
|
||||||
|
Reference in New Issue
Block a user