mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-06-01 21:31:36 +02:00
Show error if refresh fails
This commit is contained in:
@@ -74,3 +74,7 @@ div.binary-file.full-size(
|
||||
i.fa.fa-fw.fa-download
|
||||
|
|
||||
| #{translate("download")}
|
||||
div(ng-if="refreshError")
|
||||
br
|
||||
.alert.alert-danger.col-md-6.col-md-offset-3
|
||||
| Error: {{ refreshError}}
|
||||
|
||||
@@ -31,6 +31,7 @@ define [
|
||||
data: null
|
||||
|
||||
$scope.refreshing = false
|
||||
$scope.refreshError = null
|
||||
|
||||
MAX_URL_LENGTH = 60
|
||||
FRONT_OF_URL_LENGTH = 35
|
||||
@@ -48,6 +49,7 @@ define [
|
||||
|
||||
$scope.refreshFile = (file) ->
|
||||
$scope.refreshing = true
|
||||
$scope.refreshError = null
|
||||
ide.fileTreeManager.refreshLinkedFile(file)
|
||||
.then (response) ->
|
||||
{ data } = response
|
||||
@@ -57,6 +59,9 @@ define [
|
||||
ide.binaryFilesManager.openFileById(new_file_id)
|
||||
, 1000
|
||||
)
|
||||
$scope.refreshError = null
|
||||
.catch (response) ->
|
||||
$scope.refreshError = response.data
|
||||
.finally () ->
|
||||
$scope.refreshing = false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user