show Content if currect file is no directory

This commit is contained in:
Maren Süwer
2018-10-25 11:27:31 +02:00
parent 6ca66c27d1
commit 20df283b08
7 changed files with 141 additions and 53 deletions

View File

@@ -102,6 +102,20 @@ export default function reducer(
// selectors
export function isDirectory(
state: any,
repository: Repository,
revision: string,
path: string
): boolean {
const currentFile = getSources(state, repository, revision, path);
if (currentFile && !currentFile.directory) {
return false;
} else {
return true; //also return true if no currentFile is found since it is the "default" path
}
}
export function getSources(
state: any,
repository: Repository,