mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 09:09:36 +02:00
[web] Try various file extensions for preview urls (#11467)
GitOrigin-RevId: 1dd8001c337b10450c83a58b4ab0904867a21250
This commit is contained in:
committed by
Copybot
parent
fd90261313
commit
83e4a2fab6
@@ -293,10 +293,21 @@ export default FileTreeManager = class FileTreeManager {
|
||||
}
|
||||
|
||||
getPreviewUrlByPath(path) {
|
||||
const entity = this.findEntityByPath(path)
|
||||
return entity
|
||||
? `/project/${this.$scope.project._id}/file/${entity.id}`
|
||||
: null
|
||||
for (const extension of [
|
||||
'',
|
||||
'.png',
|
||||
'.jpg',
|
||||
'.jpeg',
|
||||
'.PNG',
|
||||
'.JPG',
|
||||
'.JPEG',
|
||||
]) {
|
||||
const entity = this.findEntityByPath(path + extension)
|
||||
if (entity) {
|
||||
return `/project/${this.$scope.project._id}/file/${entity.id}`
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
|
||||
_findEntityByPathInFolder(folder, path) {
|
||||
|
||||
Reference in New Issue
Block a user