chore: teams filter improvements (#14315)
* Changed translations, many languages were wrong * Clear localStorage from the useTypedQuery * Missed one
This commit is contained in:
1 parent
9bd3a362a2
commit
1132d9d0dc
12 files changed
+15
-56
No files matched your search
@@ -15,10 +15,9 @@ import { filterQuerySchema } from "../lib/getTeamsFiltersFromQuery";
|
||||
export type IEventTypesFilters = RouterOutputs["viewer"]["eventTypes"]["listWithTeam"];
|
||||
export type IEventTypeFilter = IEventTypesFilters[0];
|
||||
|
||||
export const TEAMS_FILTER_KEY = "TEAMS_FILTER_KEY";
|
||||
function useFilterQuery() {
|
||||
// passthrough allows additional params to not be removed
|
||||
return useTypedQuery(filterQuerySchema.passthrough(), TEAMS_FILTER_KEY);
|
||||
return useTypedQuery(filterQuerySchema.passthrough());
|
||||
}
|
||||
|
||||
export const TeamsFilter = ({
|
||||
@@ -32,11 +31,14 @@ export const TeamsFilter = ({
|
||||
}) => {
|
||||
const { t } = useLocale();
|
||||
const session = useSession();
|
||||
|
||||
const { data: query, pushItemToKey, removeItemByKeyAndValue, removeAllQueryParams } = useFilterQuery();
|
||||
|
||||
const { data: teams } = trpc.viewer.teams.list.useQuery(undefined, {
|
||||
// Teams don't change that frequently
|
||||
refetchOnWindowFocus: false,
|
||||
});
|
||||
|
||||
const getCheckedOptionsNames = () => {
|
||||
const checkedOptions: string[] = [];
|
||||
const teamIds = query.teamIds;
|
||||
|
||||
Reference in new issue
Block a user