Commit 596e53e2 authored by Luke "Jared" Bennett's avatar Luke "Jared" Bennett

Fix eslint offenses

parent e58d30a0
...@@ -65,7 +65,7 @@ const RepoEditor = { ...@@ -65,7 +65,7 @@ const RepoEditor = {
}, },
editMode() { editMode() {
console.log('edit mode changed') console.log('edit mode changed');
const readOnly = !this.editMode; const readOnly = !this.editMode;
Store.readOnly = readOnly; Store.readOnly = readOnly;
......
...@@ -19,7 +19,7 @@ const RepoHelper = { ...@@ -19,7 +19,7 @@ const RepoHelper = {
newContent: '', newContent: '',
changed: false, changed: false,
loading: false, loading: false,
} };
}, },
key: '', key: '',
...@@ -135,7 +135,7 @@ const RepoHelper = { ...@@ -135,7 +135,7 @@ const RepoHelper = {
getContent(treeOrFile, cb) { getContent(treeOrFile, cb) {
let file = treeOrFile; let file = treeOrFile;
console.log('file',file) console.log('file', file);
// const loadingData = RepoHelper.setLoading(true); // const loadingData = RepoHelper.setLoading(true);
return Service.getContent() return Service.getContent()
.then((response) => { .then((response) => {
...@@ -174,14 +174,14 @@ const RepoHelper = { ...@@ -174,14 +174,14 @@ const RepoHelper = {
} }
} else { } else {
// it's a tree // it's a tree
if(!file) Store.isRoot = RepoHelper.isRoot(Service.url); if (!file) Store.isRoot = RepoHelper.isRoot(Service.url);
file = RepoHelper.setDirectoryOpen(file); file = RepoHelper.setDirectoryOpen(file);
const newDirectory = RepoHelper.dataToListOfFiles(data); const newDirectory = RepoHelper.dataToListOfFiles(data);
Store.addFilesToDirectory(file, Store.files, newDirectory); Store.addFilesToDirectory(file, Store.files, newDirectory);
Store.prevURL = Service.blobURLtoParentTree(Service.url); Store.prevURL = Service.blobURLtoParentTree(Service.url);
} }
}) })
.catch((e) => { .catch(() => {
// RepoHelper.setLoading(false, loadingData); // RepoHelper.setLoading(false, loadingData);
RepoHelper.loadingError(); RepoHelper.loadingError();
}); });
......
...@@ -28,7 +28,7 @@ const RepoStore = { ...@@ -28,7 +28,7 @@ const RepoStore = {
tabsOverflow: 41, tabsOverflow: 41,
tempPrivateToken: '', tempPrivateToken: '',
submitCommitsLoading: false, submitCommitsLoading: false,
binaryLoaded:false, binaryLoaded: false,
activeFile: RepoHelper.getDefaultActiveFile(), activeFile: RepoHelper.getDefaultActiveFile(),
activeFileIndex: 0, activeFileIndex: 0,
activeLine: 0, activeLine: 0,
...@@ -137,24 +137,24 @@ const RepoStore = { ...@@ -137,24 +137,24 @@ const RepoStore = {
if (file.type === 'tree') return; if (file.type === 'tree') return;
let foundIndex; let foundIndex;
RepoStore.openedFiles = RepoStore.openedFiles.filter((openedFile, i) => { RepoStore.openedFiles = RepoStore.openedFiles.filter((openedFile, i) => {
if(openedFile.url === file.url) foundIndex = i; if (openedFile.url === file.url) foundIndex = i;
return openedFile.url !== file.url; return openedFile.url !== file.url;
}); });
// now activate the right tab based on what you closed. // now activate the right tab based on what you closed.
if(RepoStore.openedFiles.length === 0) { if (RepoStore.openedFiles.length === 0) {
console.log('open 0') console.log('open 0');
RepoStore.activeFile = {}; RepoStore.activeFile = {};
return; return;
} }
if(RepoStore.openedFiles.length === 1 || foundIndex === 0) { if (RepoStore.openedFiles.length === 1 || foundIndex === 0) {
RepoStore.setActiveFiles(RepoStore.openedFiles[0]); RepoStore.setActiveFiles(RepoStore.openedFiles[0]);
return; return;
} }
if(foundIndex) { if (foundIndex) {
if(foundIndex > 0) { if (foundIndex > 0) {
RepoStore.setActiveFiles(RepoStore.openedFiles[foundIndex - 1]); RepoStore.setActiveFiles(RepoStore.openedFiles[foundIndex - 1]);
} }
} }
......
...@@ -3,7 +3,7 @@ import repoCommitSection from '~/repo/repo_commit_section.vue'; ...@@ -3,7 +3,7 @@ import repoCommitSection from '~/repo/repo_commit_section.vue';
import RepoStore from '~/repo/repo_store'; import RepoStore from '~/repo/repo_store';
import Api from '~/api'; import Api from '~/api';
fdescribe('RepoCommitSection', () => { describe('RepoCommitSection', () => {
const openedFiles = [{ const openedFiles = [{
id: 0, id: 0,
changed: true, changed: true,
......
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