fix: stop silent Jobs filters from emptying Discovered
Hide-prior-skips is off by default and counts in the badge when on; Settings searchCities no longer hard-filters the Jobs list.
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
import { useSettings } from "@client/hooks/useSettings";
|
||||
import { buildDuplicateDismissHints } from "@client/lib/job-dedup";
|
||||
import { inferCountryKeyFromSearchGeography } from "@shared/search-cities";
|
||||
import type React from "react";
|
||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||
import { useNavigate, useParams } from "react-router-dom";
|
||||
@@ -168,12 +167,6 @@ export const OrchestratorPage: React.FC = () => {
|
||||
[settings],
|
||||
);
|
||||
|
||||
const searchGeographyCountryKey = useMemo(
|
||||
() =>
|
||||
inferCountryKeyFromSearchGeography(settings?.searchCities?.value ?? null),
|
||||
[settings?.searchCities?.value],
|
||||
);
|
||||
|
||||
const duplicateDismissHints = useMemo(
|
||||
() => (hidePriorSkips ? buildDuplicateDismissHints(jobs) : undefined),
|
||||
[hidePriorSkips, jobs],
|
||||
@@ -188,7 +181,7 @@ export const OrchestratorPage: React.FC = () => {
|
||||
settingsBlockedEmployerKeywords: applySettingsCompanySkipList
|
||||
? settingsSkipEmployerKeywords
|
||||
: [],
|
||||
searchGeographyCountryKey,
|
||||
searchGeographyCountryKey: null,
|
||||
duplicateDismissHints,
|
||||
}),
|
||||
[
|
||||
@@ -198,7 +191,6 @@ export const OrchestratorPage: React.FC = () => {
|
||||
employerExcludeFilter,
|
||||
applySettingsCompanySkipList,
|
||||
settingsSkipEmployerKeywords,
|
||||
searchGeographyCountryKey,
|
||||
duplicateDismissHints,
|
||||
],
|
||||
);
|
||||
|
||||
@@ -257,7 +257,7 @@ export const OrchestratorFilters: React.FC<OrchestratorFiltersProps> = ({
|
||||
employerIncludeFilter.length > 0 || employerExcludeFilter.length > 0,
|
||||
) +
|
||||
Number(!applySettingsCompanySkipList) +
|
||||
Number(!hidePriorSkips) +
|
||||
Number(hidePriorSkips) +
|
||||
Number(sponsorFilter !== "all") +
|
||||
Number(sponsorshipSignalsFilter.length > 0) +
|
||||
Number(hideSponsorBlockers) +
|
||||
|
||||
@@ -436,7 +436,7 @@ export const useOrchestratorFilters = () => {
|
||||
);
|
||||
|
||||
const hidePriorSkips = useMemo(
|
||||
() => searchParams.get("hidePriorSkips") !== "0",
|
||||
() => searchParams.get("hidePriorSkips") === "1",
|
||||
[searchParams],
|
||||
);
|
||||
|
||||
@@ -458,8 +458,8 @@ export const useOrchestratorFilters = () => {
|
||||
(value: boolean) => {
|
||||
setSearchParams(
|
||||
(prev) => {
|
||||
if (value) prev.delete("hidePriorSkips");
|
||||
else prev.set("hidePriorSkips", "0");
|
||||
if (value) prev.set("hidePriorSkips", "1");
|
||||
else prev.delete("hidePriorSkips");
|
||||
return prev;
|
||||
},
|
||||
{ replace: true },
|
||||
|
||||
Reference in New Issue
Block a user