mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 22:23:42 +01:00
Merge pull request #22178 from overleaf/jpa-file-view-hash-2
[web] migrate file-view to download from history-v1 (via web) 2/2 GitOrigin-RevId: 93172cbbd2d19a55bb27f5b0ca0b494f815a3632
This commit is contained in:
@@ -106,8 +106,7 @@ export function findEntityByPath(
|
||||
export function previewByPath(
|
||||
folder: Folder,
|
||||
projectId: string,
|
||||
path: string,
|
||||
fileTreeFromHistory: boolean
|
||||
path: string
|
||||
): PreviewPath | null {
|
||||
for (const suffix of [
|
||||
'',
|
||||
@@ -125,9 +124,7 @@ export function previewByPath(
|
||||
if (result?.type === 'fileRef') {
|
||||
const { name, _id: id, hash } = result.entity
|
||||
return {
|
||||
url: fileTreeFromHistory
|
||||
? `/project/${projectId}/blob/${hash}`
|
||||
: `/project/${projectId}/file/${id}`,
|
||||
url: `/project/${projectId}/blob/${hash}?fallback=${id}`,
|
||||
extension: name.slice(name.lastIndexOf('.') + 1),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user