Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions lib/datadistributor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,13 @@ export const DataDistributor = function () {
refresh();
}

function refresh() {
function refresh(withoutObservers?: boolean) {
if (data === undefined) {
return;
}
notifyObservers();
if (!withoutObservers) {
notifyObservers();
}

let filter: FilterMethod = filters.reduce(
function (a: FilterMethod, filter) {
Expand Down
6 changes: 4 additions & 2 deletions lib/filters/hostname.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,17 @@ import { CanRender } from "../container.js";
import { Filter } from "../datadistributor.js";

export const HostnameFilter = function (): CanRender & Filter {
let refreshFunctions: (() => any)[] = [];
let refreshFunctions: ((bool?) => any)[] = [];
let timer: ReturnType<typeof setTimeout>;
let input = document.createElement("input");

function refresh() {
clearTimeout(timer);
timer = setTimeout(function () {
refreshFunctions.forEach(function (f) {
f();
// observer gui function recreates the filter this removes the input focus
// the hostname filter should therefore not notifyObservers on refresh
f(true);
});
}, 250);
}
Expand Down