SearchResults: remove computed search prop

It is only used in one location, and not from the template.
In other words we should inline it to make the code simpler.
This commit is contained in:
Reto Brunner 2022-11-12 16:48:01 +01:00
parent 0fa203569a
commit 6b617f893d

View File

@ -129,13 +129,14 @@ export default defineComponent({
const oldScrollTop = ref(0);
const oldChatHeight = ref(0);
const search = computed(() => store.state.messageSearchResults);
const messages = computed(() => {
if (!search.value) {
const results = store.state.messageSearchResults?.results;
if (!results) {
return [];
}
return search.value.results;
return results;
});
const chan = computed(() => {
@ -307,7 +308,6 @@ export default defineComponent({
loadMoreButton,
messages,
moreResultsAvailable,
search,
network,
channel,
route,