fix showing search results

This commit is contained in:
Jonas Heinrich 2020-11-10 17:45:12 +01:00
parent c15932c590
commit f4ac135246
3 changed files with 17 additions and 3 deletions

View File

@ -64,12 +64,12 @@ class SearchProvider implements IProvider {
$body = $response->getBody();
$parsed = json_decode($body, true);
$result = array_map(function (array $result) {
$result = array_map(function (array $result) use ($term) {
return new SearchResultEntry(
$result['favicon'],
$result['name'],
str_replace(",",", ",$result['tags']),
'#/search/virus',
$this->url->linkToRouteAbsolute('radio.page.index') . 'search/'.$term.'#/search/'.$term,
'icon-radio'
);
}, $parsed);

View File

@ -25,7 +25,11 @@
v-if="isSearch"
:to="{ name: 'SEARCH' }"
icon="icon-search"
:title="t('radio', 'Search')" />
:title="t('radio', 'Search')">
<AppNavigationCounter slot="counter" :highlighted="true">
99+
</AppNavigationCounter>
</AppNavigationItem>
</template>
<template #footer>
<Player
@ -37,6 +41,7 @@
<script>
import AppNavigation from '@nextcloud/vue/dist/Components/AppNavigation'
import AppNavigationItem from '@nextcloud/vue/dist/Components/AppNavigationItem'
import AppNavigationCounter from '@nextcloud/vue/dist/Components/AppNavigationCounter'
import Player from './Player'
export default {
@ -44,6 +49,7 @@ export default {
components: {
AppNavigation,
AppNavigationItem,
AppNavigationCounter,
Player,
},
computed: {

View File

@ -47,6 +47,13 @@ const router = new Router({
})
router.beforeEach((to, from, next) => {
if (to.hash) {
const hashPath = to.hash.substr(1)
next(hashPath)
return
}
if (to.name) {
store.dispatch('setMenuState', to.name)
next()
@ -60,6 +67,7 @@ router.beforeEach((to, from, next) => {
next({ name: value })
})
}
})
export default router