Skip to content

Commit

Permalink
Do not show location if file is in root
Browse files Browse the repository at this point in the history
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
  • Loading branch information
skjnldsv committed Jul 23, 2020
1 parent 7a0bbdc commit a4c1fd8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion apps/files/lib/Search/FilesSearchProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ public function search(IUser $user, ISearchQuery $query): SearchResult {
return new FilesSearchResultEntry(
$this->urlGenerator->linkToRoute('core.Preview.getPreviewByFileId', ['x' => 32, 'y' => 32, 'fileId' => $result->id]),
$result->name,
$result->path,
// Do not show the location if the file is in root
$result->path !== '/' . $result->name ? $result->path : '',
$result->link
);
}, $this->fileSearch->search($query->getTerm()))
Expand Down

0 comments on commit a4c1fd8

Please sign in to comment.