Files
overleaf-cep/services/web/frontend/js/features/utils/fileUrl.js
Brian Gough a08d1b18dc Merge pull request #22378 from overleaf/bg-issue22368
Fix frontend to handle missing hashes for image preview

GitOrigin-RevId: e67300d9b08b02b1670cb3a7bbd4483cf4486f51
2024-12-10 09:04:29 +00:00

11 lines
336 B
JavaScript

// Helper function to compute the url for a file in history-v1 or filestore.
// This will be obsolete when the migration to history-v1 is complete.
export function fileUrl(projectId, id, hash) {
if (hash) {
return `/project/${projectId}/blob/${hash}?fallback=${id}`
} else {
return `/project/${projectId}/file/${id}`
}
}