Skip to content

Commit 603aaf8

Browse files
committed
fix redirection (#1032)
1 parent 0378be3 commit 603aaf8

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

src/components/ResourceViewer.js

+8-3
Original file line numberDiff line numberDiff line change
@@ -2293,7 +2293,7 @@ class ResourceViewer extends Component<Props,State>
22932293
prop[tmp+"BDRCworkId"] = [{
22942294
type:"html",
22952295
value:<span>
2296-
<Link to={window.location.hostname === "localhost" || window.location.hostname.startsWith("library-dev")
2296+
<Link to={window.location.hostname != "library.bdrc.io"
22972297
? "/show/"+shortUri(prop[bdo+"instanceOf"]?.[0]?.value)
22982298
: prop[bdo+"instanceOf"]?.[0]?.value}>
22992299
{I18n.t("resource.workId1")}
@@ -10201,13 +10201,18 @@ perma_menu(pdfLink,monoVol,fairUse,other,accessET, onlyDownload)
1020110201
//loggergen.log("WithD?",redir);
1020210202
if(redir[adm+"replaceWith"]) {
1020310203
redir = shortUri(redir[adm+"replaceWith"][0].value)
10204-
10204+
10205+
//loggergen.log("rw:", redir, this.props);
10206+
1020510207
let path = "/show/"
1020610208
if(this.props.simple) path = "/simple/"
1020710209
if(this.props.preview) path = "/preview/"
1020810210

1020910211
if(redir != this.props.IRI) {
10210-
return (
10212+
if(this.props.pdfDownloadOnly) {
10213+
return <ResourceViewerContainer {...this.props} IRI={redir}/>
10214+
}
10215+
else return (
1021110216
<Redirect404 navigate={this.props.navigate} location={this.props.location} message={"Record withdrawn in favor of "+redir} to={path+redir+this.props.location.search+this.props.location.hash} />
1021210217
)
1021310218
}

0 commit comments

Comments
 (0)