Skip to content

armgit / macro

Public Imported from GitHub
0

Macro is a unified workspace for teams: email, chat, docs, tasks, agents, calls, and CRM — @-linked together with shared AI memory.

fix(search): clear sub-filter caches when resetting to tab defaults (#2900)

gbirman2078a1cd7182
diff --git a/js/app/packages/app/component/next-soup/soup-view/filters-bar/use-filter-refinements.tsx b/js/app/packages/app/component/next-soup/soup-view/filters-bar/use-filter-refinements.tsx
index 1690e74aeb..453400409e 100644
--- a/js/app/packages/app/component/next-soup/soup-view/filters-bar/use-filter-refinements.tsx
+++ b/js/app/packages/app/component/next-soup/soup-view/filters-bar/use-filter-refinements.tsx
@@ -20,6 +20,9 @@ import { type Accessor, batch, createMemo, createSignal } from 'solid-js';
import type { ActiveFilter } from './active-filter-chips';
import { INDEX_OPTIONS } from './search-filter-controls';
import {
+ cacheCallSubFilters,
+ cacheChannelSubFilters,
+ cacheEmailSubFilters,
type SearchableOption,
useSearchFilterOptions,
useSearchIndexController,
@@ -504,10 +507,15 @@ export function useFilterRefinements() {
const preset = currentPreset();
if (!preset) return;
+ const contentId = panel.handle.content().id;
+
batch(() => {
soup.predicates.set(preset.clientFilters);
queryFilters.replace(preset.filters ?? null);
setAssigneeFilter([]);
+ cacheChannelSubFilters(contentId, {});
+ cacheCallSubFilters(contentId, {});
+ cacheEmailSubFilters(contentId, {});
});
};