Show error if refresh fails

This commit is contained in:
Shane Kilkelly 2018-05-21 11:02:12 +01:00
parent 7d8c7bebe2
commit 1f2ee4e3fc
2 changed files with 9 additions and 0 deletions

View file

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

View file

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