feat: Collaborative revision restore (#2721)

This commit is contained in:
Tom Moor
2021-11-07 08:58:44 -08:00
committed by GitHub
parent 5dd5df6268
commit b2a1e6b309
6 changed files with 57 additions and 17 deletions

View File

@@ -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} />