diff --git a/client/pages/sharepage.js b/client/pages/sharepage.js index 0037d38e..e909505f 100644 --- a/client/pages/sharepage.js +++ b/client/pages/sharepage.js @@ -16,7 +16,8 @@ export class SharePage extends React.Component { path: null, key: null, error: null, - loading: false + loading: false, + isUploader: false, }; } @@ -44,7 +45,8 @@ export class SharePage extends React.Component { key: res.key, path: res.path || null, share: res.id, - loading: false + loading: false, + isUploader: res.can_read === false && res.can_write === false && res.can_upload === true, }; if(res.message){ notify.send(res.message, "info"); @@ -81,7 +83,7 @@ export class SharePage extends React.Component { ); } notify.send(t("You can't do that :)"), "error"); - } else if (CONFIG["share_redirect"] !== "") { + } else if (CONFIG["share_redirect"] !== "" && this.state.isUploader === false) { requestAnimationFrame(() => { window.location.href = CONFIG["share_redirect"].replace("{{path}}", this.state.path); }); diff --git a/server/ctrl/share.go b/server/ctrl/share.go index b5d44c6a..5b19dda9 100644 --- a/server/ctrl/share.go +++ b/server/ctrl/share.go @@ -174,10 +174,16 @@ func ShareVerifyProof(ctx App, res http.ResponseWriter, req *http.Request) { } SendSuccessResult(res, struct { - Id string `json:"id"` - Path string `json:"path"` + Id string `json:"id"` + Path string `json:"path"` + CanRead bool `json:"can_read"` + CanWrite bool `json:"can_write"` + CanUpload bool `json:"can_upload"` }{ - Id: s.Id, - Path: s.Path, + Id: s.Id, + Path: s.Path, + CanRead: s.CanRead, + CanWrite: s.CanWrite, + CanUpload: s.CanUpload, }) }