Skip to content

Commit 9d382ff

Browse files
committed
Add check against hostname
1 parent 7aab28e commit 9d382ff

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

app/preprint/[id]/preprint-viewer.tsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -200,13 +200,15 @@ const PreprintViewer = ({
200200
file={preprint.versions[0].public_download_url}
201201
onLoadSuccess={(pdf: PDFDocumentProxy) => setPdf(pdf)}
202202
onLoadError={(error) =>
203-
alertOnError({
204-
endpoint: preprint.versions[0].public_download_url,
205-
status: 'n/a',
206-
statusText: 'unknown',
207-
method: 'GET',
208-
apiError: error.message,
209-
})
203+
window.location.hostname.includes('cdrxiv.org')
204+
? alertOnError({
205+
endpoint: preprint.versions[0].public_download_url,
206+
status: 'n/a',
207+
statusText: 'unknown',
208+
method: 'GET',
209+
apiError: error.message,
210+
})
211+
: undefined
210212
}
211213
loading={
212214
<Flex

0 commit comments

Comments
 (0)