feat: Collaborative revision restore (#2721)
This commit is contained in:
@@ -24,6 +24,7 @@ import { type LocationWithState, type NavigationNode } from "types";
|
||||
import { NotFoundError, OfflineError } from "utils/errors";
|
||||
import { matchDocumentEdit, updateDocumentUrl } from "utils/routeHelpers";
|
||||
import { isInternalUrl } from "utils/urls";
|
||||
|
||||
type Props = {|
|
||||
match: Match,
|
||||
auth: AuthStore,
|
||||
@@ -45,6 +46,7 @@ class DataLoader extends React.Component<Props> {
|
||||
sharedTree: ?NavigationNode;
|
||||
@observable document: ?Document;
|
||||
@observable revision: ?Revision;
|
||||
@observable shapshot: ?Blob;
|
||||
@observable error: ?Error;
|
||||
|
||||
componentDidMount() {
|
||||
@@ -223,7 +225,8 @@ class DataLoader extends React.Component<Props> {
|
||||
};
|
||||
|
||||
render() {
|
||||
const { location, policies, auth, ui } = this.props;
|
||||
const { location, policies, auth, match, ui } = this.props;
|
||||
const { revisionId } = match.params;
|
||||
|
||||
if (this.error) {
|
||||
return this.error instanceof OfflineError ? (
|
||||
@@ -237,7 +240,7 @@ class DataLoader extends React.Component<Props> {
|
||||
const document = this.document;
|
||||
const revision = this.revision;
|
||||
|
||||
if (!document || !team) {
|
||||
if (!document || !team || (revisionId && !revision)) {
|
||||
return (
|
||||
<>
|
||||
<Loading location={location} />
|
||||
|
||||
Reference in New Issue
Block a user