Merge pull request #3419 from overleaf/ta-select-file-type-fix

[ReactFileTree] Fix File Type for `entity:selected` Event

GitOrigin-RevId: 61f6746048931c1729ff640ef89eb78cf3de2723
This commit is contained in:
Jakob Ackermann 2020-11-27 13:11:31 +00:00 committed by Copybot
parent 6eeb7857e3
commit 1791673d41

View file

@ -43,10 +43,12 @@ App.controller('ReactFileTreeController', function(
$scope.onSelect = selectedEntities => {
if (selectedEntities.length === 1) {
const selectedEntity = selectedEntities[0]
const type =
selectedEntity.type === 'fileRef' ? 'file' : selectedEntity.type
$scope.$emit('entity:selected', {
id: selectedEntity.entity._id,
name: selectedEntity.entity.name,
type: selectedEntity.type
type
})
// in the react implementation there is no such concept as "1