fix: Handle error revoking share link on frontend

This commit is contained in:
Tom Moor 2020-08-31 20:24:05 -07:00
parent dd0d51dd9d
commit 759d4a5ac2
1 changed files with 8 additions and 3 deletions

View File

@ -31,10 +31,15 @@ class ShareMenu extends React.Component<Props> {
this.redirectTo = this.props.share.documentUrl;
};
handleRevoke = (ev: SyntheticEvent<>) => {
handleRevoke = async (ev: SyntheticEvent<>) => {
ev.preventDefault();
this.props.shares.revoke(this.props.share);
this.props.ui.showToast("Share link revoked");
try {
await this.props.shares.revoke(this.props.share);
this.props.ui.showToast("Share link revoked");
} catch (err) {
this.props.ui.showToast(err.message);
}
};
handleCopy = () => {