mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-28 20:00:10 +02:00

[web] only use history for blobs when enabled GitOrigin-RevId: 010983e9b29657d4c594e03945dca5700577bf0a
14 lines
479 B
JavaScript
14 lines
479 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.
|
|
|
|
import getMeta from '@/utils/meta'
|
|
|
|
const projectHistoryBlobsEnabled = getMeta('ol-projectHistoryBlobsEnabled')
|
|
|
|
export function fileUrl(projectId, id, hash) {
|
|
if (projectHistoryBlobsEnabled && hash) {
|
|
return `/project/${projectId}/blob/${hash}?fallback=${id}`
|
|
} else {
|
|
return `/project/${projectId}/file/${id}`
|
|
}
|
|
}
|