فهرست منبع

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

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

GitOrigin-RevId: 61f6746048931c1729ff640ef89eb78cf3de2723
Jakob Ackermann 5 سال پیش
والد
کامیت
1791673d41
1فایلهای تغییر یافته به همراه3 افزوده شده و 1 حذف شده
  1. 3 1
      services/web/frontend/js/features/file-tree/controllers/file-tree-controller.js

+ 3 - 1
services/web/frontend/js/features/file-tree/controllers/file-tree-controller.js

@@ -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