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

Fix loading.

parent aac0bc09
...@@ -29,7 +29,7 @@ export default RepoLoadingFile; ...@@ -29,7 +29,7 @@ export default RepoLoadingFile;
</script> </script>
<template> <template>
<tr v-if="loading.tree && !hasFiles" class="loading-file"> <tr v-if="!hasFiles" class="loading-file">
<td> <td>
<div class="animation-container animation-container-small"> <div class="animation-container animation-container-small">
<div v-for="n in 6" :class="lineOfCode(n)" :key="n"></div> <div v-for="n in 6" :class="lineOfCode(n)" :key="n"></div>
......
...@@ -216,15 +216,21 @@ const RepoHelper = { ...@@ -216,15 +216,21 @@ const RepoHelper = {
serializeRepoEntity(type, entity) { serializeRepoEntity(type, entity) {
const { url, name, icon, last_commit } = entity; const { url, name, icon, last_commit } = entity;
return { let returnObj = {
type, type,
name, name,
url, url,
lastCommitUrl: `${Store.projectUrl}/commit/${last_commit.id}`,
icon: RepoHelper.toFA(icon), icon: RepoHelper.toFA(icon),
level: 0, level: 0,
loading: false, loading: false,
}; };
if(entity.last_commit){
returnObj.lastCommitUrl = `${Store.projectUrl}/commit/${last_commit.id}`;
} else {
returnObj.lastCommitUrl = '';
}
return returnObj;
}, },
scrollTabsRight() { scrollTabsRight() {
...@@ -283,7 +289,7 @@ const RepoHelper = { ...@@ -283,7 +289,7 @@ const RepoHelper = {
return Store.openedFiles.find(openedFile => Store.activeFile.url === openedFile.url); return Store.openedFiles.find(openedFile => Store.activeFile.url === openedFile.url);
}, },
loadingError() { loadingError(e) {
Flash('Unable to load the file at this time.'); Flash('Unable to load the file at this time.');
}, },
}; };
......
...@@ -63,7 +63,7 @@ const RepoService = { ...@@ -63,7 +63,7 @@ const RepoService = {
blobURLtoParentTree(url) { blobURLtoParentTree(url) {
const urlArray = url.split('/'); const urlArray = url.split('/');
urlArray.pop(); urlArray.pop();
const blobIndex = urlArray.indexOf('blob'); const blobIndex = urlArray.lastIndexOf('blob');
if (blobIndex > -1) urlArray[blobIndex] = 'tree'; 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