Skip to content

Commit

Permalink
feat: improve console filter to not run when there is no filter selected
Browse files Browse the repository at this point in the history
  • Loading branch information
johann-crabnebula committed Feb 7, 2024
1 parent 81aabd8 commit f343dce
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions clients/web/src/lib/console/filter-logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ export const filterLogs = (
monitorData: MonitorData,
filter: LogFilterObject,
logs: MonitorData["logs"]
) =>
logs.filter((log) => {
) => {
if (!filter.textContent && !filter.levels.length) return logs;

return logs.filter((log) => {
if (!filter.textContent && !filter.levels.length) return true;

const metadata = getLogMetadata(monitorData, log);
Expand All @@ -32,3 +34,4 @@ export const filterLogs = (

return matchesTextContent && matchesLevel;
});
};

0 comments on commit f343dce

Please sign in to comment.