Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion components/work/WorkDocument.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export const WorkDocument = ({ work, metadata }: WorkDocumentProps) => {
<div className="bg-white rounded-lg shadow-sm border mb-6 relative">
{work.pdfCopyrightAllowsDisplay ? (
<DocumentViewer
url={pdfFormat.internalUrl || pdfFormat.url}
url={pdfFormat.url}
className="min-h-[800px]"
onPdfUnavailable={() => setPdfUnavailable(true)}
/>
Expand Down
21 changes: 0 additions & 21 deletions services/proxy.service.ts

This file was deleted.

23 changes: 3 additions & 20 deletions types/work.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@ import { Topic, transformTopic } from './topic';
import { createTransformer, BaseTransformed } from './transformer';
import { Hub } from './hub';
import { NoteWithContent, transformNoteWithContent } from './note';
import { ProxyService } from '../services/proxy.service';
import { stripHtml } from '../utils/stringUtils';
import { transformUser, TransformedUser } from './user';
import { transformTip, Tip } from './tip';
import { transformProposalReview, type ProposalReview } from './aiPeerReview';
import type { FundingPool, GrantApplicationVisibility } from './grant';
Expand Down Expand Up @@ -74,10 +72,6 @@ export type DocumentVersion = {
export interface FormatType {
type: string;
url: string;
/**
* This is a proxied URL for internal use (e.g., to avoid CORS issues when rendering PDFs).
*/
internalUrl?: string;
}

export interface Work {
Expand Down Expand Up @@ -320,21 +314,10 @@ export const transformWork = createTransformer<any, Work>((raw) => {
doi: raw.doi,
journal: transformJournal(raw),
formats: raw.file
? [...(raw.formats || []), { type: 'PDF', url: raw.file, internalUrl: raw.file }]
? [...(raw.formats || []), { type: 'PDF', url: raw.file }]
: raw.pdf_url
? [
...(raw.formats || []),
{
type: 'PDF',
url: raw.pdf_url,
internalUrl: ProxyService.generateProxyUrl(raw.pdf_url),
},
]
: (raw.formats || []).map((format: FormatType) => ({
...format,
internalUrl:
format.type === 'PDF' ? ProxyService.generateProxyUrl(format.url) : undefined,
})),
? [...(raw.formats || []), { type: 'PDF', url: raw.pdf_url }]
: raw.formats || [],
license: raw.pdf_license,
pdfCopyrightAllowsDisplay: raw.pdf_copyright_allows_display,
figures: raw.first_preview
Expand Down
Loading