mirror of
https://github.com/element-hq/element-web
synced 2024-11-23 17:56:01 +03:00
Searching: Remove the func suffix from our search functions.
This commit is contained in:
parent
a4ad8151f8
commit
0e3a0008df
1 changed files with 5 additions and 5 deletions
|
@ -35,11 +35,11 @@ function serverSideSearch(term, roomId = undefined) {
|
||||||
return searchPromise;
|
return searchPromise;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function combinedSearchFunc(searchTerm) {
|
async function combinedSearch(searchTerm) {
|
||||||
// Create two promises, one for the local search, one for the
|
// Create two promises, one for the local search, one for the
|
||||||
// server-side search.
|
// server-side search.
|
||||||
const serverSidePromise = serverSideSearch(searchTerm);
|
const serverSidePromise = serverSideSearch(searchTerm);
|
||||||
const localPromise = localSearchFunc(searchTerm);
|
const localPromise = localSearch(searchTerm);
|
||||||
|
|
||||||
// Wait for both promises to resolve.
|
// Wait for both promises to resolve.
|
||||||
await Promise.all([serverSidePromise, localPromise]);
|
await Promise.all([serverSidePromise, localPromise]);
|
||||||
|
@ -74,7 +74,7 @@ async function combinedSearchFunc(searchTerm) {
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
async function localSearchFunc(searchTerm, roomId = undefined) {
|
async function localSearch(searchTerm, roomId = undefined) {
|
||||||
const searchArgs = {
|
const searchArgs = {
|
||||||
search_term: searchTerm,
|
search_term: searchTerm,
|
||||||
before_limit: 1,
|
before_limit: 1,
|
||||||
|
@ -115,7 +115,7 @@ function eventIndexSearch(term, roomId = undefined) {
|
||||||
if (MatrixClientPeg.get().isRoomEncrypted(roomId)) {
|
if (MatrixClientPeg.get().isRoomEncrypted(roomId)) {
|
||||||
// The search is for a single encrypted room, use our local
|
// The search is for a single encrypted room, use our local
|
||||||
// search method.
|
// search method.
|
||||||
searchPromise = localSearchFunc(term, roomId);
|
searchPromise = localSearch(term, roomId);
|
||||||
} else {
|
} else {
|
||||||
// The search is for a single non-encrypted room, use the
|
// The search is for a single non-encrypted room, use the
|
||||||
// server-side search.
|
// server-side search.
|
||||||
|
@ -124,7 +124,7 @@ function eventIndexSearch(term, roomId = undefined) {
|
||||||
} else {
|
} else {
|
||||||
// Search across all rooms, combine a server side search and a
|
// Search across all rooms, combine a server side search and a
|
||||||
// local search.
|
// local search.
|
||||||
searchPromise = combinedSearchFunc(term);
|
searchPromise = combinedSearch(term);
|
||||||
}
|
}
|
||||||
|
|
||||||
return searchPromise;
|
return searchPromise;
|
||||||
|
|
Loading…
Reference in a new issue