diff options
author | Jacob Schatz <jschatz1@gmail.com> | 2017-08-07 21:55:54 +0300 |
---|---|---|
committer | Jacob Schatz <jschatz1@gmail.com> | 2017-08-07 21:55:54 +0300 |
commit | 7435c5d4637ec2e90dba43ad0213296410c8aa79 (patch) | |
tree | 32e861a9aef25c09d6b7216f77d58896fed5a098 /app | |
parent | aac0bc09ae6f19b9d9c6de6628ff63d5daa43114 (diff) |
Fix loading.
Diffstat (limited to 'app')
-rw-r--r-- | app/assets/javascripts/repo/components/repo_loading_file.vue | 2 | ||||
-rw-r--r-- | app/assets/javascripts/repo/helpers/repo_helper.js | 12 | ||||
-rw-r--r-- | app/assets/javascripts/repo/services/repo_service.js | 2 |
3 files changed, 11 insertions, 5 deletions
diff --git a/app/assets/javascripts/repo/components/repo_loading_file.vue b/app/assets/javascripts/repo/components/repo_loading_file.vue index 38e9f16d041..31bdeac8b5c 100644 --- a/app/assets/javascripts/repo/components/repo_loading_file.vue +++ b/app/assets/javascripts/repo/components/repo_loading_file.vue @@ -29,7 +29,7 @@ export default RepoLoadingFile; </script> <template> -<tr v-if="loading.tree && !hasFiles" class="loading-file"> +<tr v-if="!hasFiles" class="loading-file"> <td> <div class="animation-container animation-container-small"> <div v-for="n in 6" :class="lineOfCode(n)" :key="n"></div> diff --git a/app/assets/javascripts/repo/helpers/repo_helper.js b/app/assets/javascripts/repo/helpers/repo_helper.js index 00c55788d6f..72436688f87 100644 --- a/app/assets/javascripts/repo/helpers/repo_helper.js +++ b/app/assets/javascripts/repo/helpers/repo_helper.js @@ -216,15 +216,21 @@ const RepoHelper = { serializeRepoEntity(type, entity) { const { url, name, icon, last_commit } = entity; - return { + let returnObj = { type, name, url, - lastCommitUrl: `${Store.projectUrl}/commit/${last_commit.id}`, icon: RepoHelper.toFA(icon), level: 0, loading: false, }; + + if(entity.last_commit){ + returnObj.lastCommitUrl = `${Store.projectUrl}/commit/${last_commit.id}`; + } else { + returnObj.lastCommitUrl = ''; + } + return returnObj; }, scrollTabsRight() { @@ -283,7 +289,7 @@ const RepoHelper = { return Store.openedFiles.find(openedFile => Store.activeFile.url === openedFile.url); }, - loadingError() { + loadingError(e) { Flash('Unable to load the file at this time.'); }, }; diff --git a/app/assets/javascripts/repo/services/repo_service.js b/app/assets/javascripts/repo/services/repo_service.js index 234159ccd9b..d0d89a15e81 100644 --- a/app/assets/javascripts/repo/services/repo_service.js +++ b/app/assets/javascripts/repo/services/repo_service.js @@ -63,7 +63,7 @@ const RepoService = { blobURLtoParentTree(url) { const urlArray = url.split('/'); urlArray.pop(); - const blobIndex = urlArray.indexOf('blob'); + const blobIndex = urlArray.lastIndexOf('blob'); if (blobIndex > -1) urlArray[blobIndex] = 'tree'; |