mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-14 06:03:45 +01:00
Only fetch labels for uploaded docs, not files
This commit is contained in:
@@ -96,9 +96,13 @@ module.exports = FileSystemImportManager =
|
||||
FileTypeManager.isBinary name, path, (error, isBinary) =>
|
||||
return callback(error) if error?
|
||||
if isBinary
|
||||
FileSystemImportManager.addFile user_id, project_id, folder_id, name, path, replace, callback
|
||||
FileSystemImportManager.addFile user_id, project_id, folder_id, name, path, replace, (err, entity) ->
|
||||
entity?.type = 'file'
|
||||
callback(err, entity)
|
||||
else
|
||||
FileSystemImportManager.addDoc user_id, project_id, folder_id, name, path, replace, callback
|
||||
FileSystemImportManager.addDoc user_id, project_id, folder_id, name, path, replace, (err, entity) ->
|
||||
entity?.type = 'doc'
|
||||
callback(err, entity)
|
||||
|
||||
|
||||
_isSafeOnFileSystem: (path, callback = (err, isSafe)->)->
|
||||
|
||||
@@ -50,5 +50,5 @@ module.exports = ProjectUploadController =
|
||||
logger.log
|
||||
project_id: project_id, file_path: path, file_name: name, folder_id: folder_id
|
||||
"uploaded file"
|
||||
res.send success: true, entity_id: entity?._id
|
||||
res.send success: true, entity_id: entity?._id, entity_type: entity?.type
|
||||
|
||||
|
||||
+3
-2
@@ -31,8 +31,9 @@ define [
|
||||
if entity.type == 'doc'
|
||||
delete @state.documents[entity.id]
|
||||
|
||||
@$scope.$on 'file:upload:complete', (e, entityId) =>
|
||||
@loadDocLabelsFromServer(entityId)
|
||||
@$scope.$on 'file:upload:complete', (e, upload) =>
|
||||
if upload.entity_type == 'doc'
|
||||
@loadDocLabelsFromServer(upload.entity_id)
|
||||
|
||||
onChange = (change) =>
|
||||
if change.remote
|
||||
|
||||
@@ -135,7 +135,7 @@ define [
|
||||
$timeout (() ->
|
||||
uploadCount--
|
||||
if response.success
|
||||
$rootScope.$broadcast 'file:upload:complete', response.entity_id
|
||||
$rootScope.$broadcast 'file:upload:complete', response
|
||||
if uploadCount == 0 and response? and response.success
|
||||
$modalInstance.close("done")
|
||||
), 250
|
||||
|
||||
Reference in New Issue
Block a user