mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 21:31:36 +02:00
Fix frontend to handle missing hashes for image preview GitOrigin-RevId: e67300d9b08b02b1670cb3a7bbd4483cf4486f51
11 lines
336 B
JavaScript
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}`
|
|
}
|
|
}
|