mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Only fetch labels for uploaded docs, not files
This commit is contained in:
parent
ff7955dfdb
commit
965a46291b
4 changed files with 11 additions and 6 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue