Skip to content

Commit

Permalink
Renamed functions
Browse files Browse the repository at this point in the history
  • Loading branch information
niemyjski committed Oct 14, 2023
1 parent 1c8ecce commit 41ed1eb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ export function updateFilters(filters: IFilter[], filter: IFilter): IFilter[] {
* @param filter The current filter string that was modified by the user
* @returns The updated filter
*/
export function updateFiltersWithUserModifications(filters: IFilter[], input: string): IFilter[] {
export function parseFilter(filters: IFilter[], input: string): IFilter[] {
const resolvedFilters: IFilter[] = [];

const keywordFilterParts = [];
Expand Down
16 changes: 8 additions & 8 deletions src/Exceptionless.Web/ClientApp/src/routes/(app)/+page.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
toFilter,
type IFilter,
updateFilters,
updateFiltersWithUserModifications
parseFilter
} from '$comp/filters/filters';
import { derived } from 'svelte/store';
Expand All @@ -31,12 +31,12 @@
filters.set(updateFilters($filters, detail));
}
let updateFiltersDebounceTimer: ReturnType<typeof setTimeout>;
function updateFiltersWithCustomInput(event: Event) {
clearTimeout(updateFiltersDebounceTimer);
updateFiltersDebounceTimer = setTimeout(() => {
let parseFiltersDebounceTimer: ReturnType<typeof setTimeout>;
function onFilterInputChanged(event: Event) {
clearTimeout(parseFiltersDebounceTimer);
parseFiltersDebounceTimer = setTimeout(() => {
const { value } = event.target as HTMLInputElement;
filters.set(updateFiltersWithUserModifications($filters, value));
filters.set(parseFilter($filters, value));
}, 500);
}
</script>
Expand All @@ -58,7 +58,7 @@
placeholder="Search..."
class="input input-sm w-full max-w-xs"
value={$filter}
on:input={updateFiltersWithCustomInput}
on:input={onFilterInputChanged}
/>
<div class="flex items-center space-x-2">
<div class="flex items-center">
Expand All @@ -85,7 +85,7 @@
placeholder="Search..."
class="input input-sm w-full max-w-xs"
value={$filter}
on:input={updateFiltersWithCustomInput}
on:input={onFilterInputChanged}
/>
<select class="select select-sm" bind:value={$time}>
<option value="last hour">Last Hour</option>
Expand Down

0 comments on commit 41ed1eb

Please sign in to comment.