Skip to content

Commit

Permalink
Merge pull request #41785 from nextcloud/fix-open-search-result
Browse files Browse the repository at this point in the history
Migrate openResult method to SearchResult component
  • Loading branch information
AndyScherzinger authored Nov 29, 2023
2 parents b213fc7 + 00bb1bc commit 0a8ceb4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
7 changes: 6 additions & 1 deletion core/src/components/GlobalSearch/SearchResult.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<NcListItem class="result-items__item"
:name="title"
:bold="false"
@click="openResult(result)">
@click="openResult(resourceUrl)">
<template #icon>
<div aria-hidden="true"
class="result-items__item-icon"
Expand Down Expand Up @@ -91,6 +91,11 @@ export default {
thumbnailErrorHandler() {
this.thumbnailHasError = true
},
openResult(url) {
if (url) {
window.location = url
}
},
},
}
</script>
Expand Down
5 changes: 0 additions & 5 deletions core/src/views/GlobalSearchModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,6 @@ export default {
})
this.results = sortedResults
},
openResult(result) {
if (result.resourceUrl) {
window.location = result.resourceUrl
}
},
mapContacts(contacts) {
return contacts.map(contact => {
return {
Expand Down
4 changes: 2 additions & 2 deletions dist/core-global-search.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/core-global-search.js.map

Large diffs are not rendered by default.

0 comments on commit 0a8ceb4

Please sign in to comment.