Commit 7435c5d4 authored by Jacob Schatz's avatar Jacob Schatz

Fix loading.

parent aac0bc09
......@@ -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>
......
......@@ -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.');
},
};
......
......@@ -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';
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment