Commit 066aa5b3 authored by Phil Hughes's avatar Phil Hughes

fixed eslint

parent cacc8f40
...@@ -24,8 +24,7 @@ export default { ...@@ -24,8 +24,7 @@ export default {
filteredBlobs() { filteredBlobs() {
const searchText = this.searchText.trim(); const searchText = this.searchText.trim();
if (searchText === '') if (searchText === '') return this.allBlobs.slice(0, MAX_RESULTS);
return this.allBlobs.sort((a, b) => b.lastOpenedAt - a.lastOpenedAt).slice(0, MAX_RESULTS);
return fuzzaldrinPlus.filter(this.allBlobs, searchText, { return fuzzaldrinPlus.filter(this.allBlobs, searchText, {
key: 'path', key: 'path',
......
...@@ -37,7 +37,8 @@ export const hasChanges = state => !!state.changedFiles.length; ...@@ -37,7 +37,8 @@ export const hasChanges = state => !!state.changedFiles.length;
export const hasMergeRequest = state => !!state.currentMergeRequestId; export const hasMergeRequest = state => !!state.currentMergeRequestId;
export const allBlobs = state => export const allBlobs = state =>
Object.keys(state.entries).reduce((acc, key) => { Object.keys(state.entries)
.reduce((acc, key) => {
const entry = state.entries[key]; const entry = state.entries[key];
if (entry.type === 'blob') { if (entry.type === 'blob') {
...@@ -45,4 +46,5 @@ export const allBlobs = state => ...@@ -45,4 +46,5 @@ export const allBlobs = state =>
} }
return acc; return acc;
}, []); }, [])
.sort((a, b) => b.lastOpenedAt - a.lastOpenedAt);
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