From 2ace0700cfcd66205787e8283fd96db22cae5d94 Mon Sep 17 00:00:00 2001 From: Studio-18 Date: Wed, 19 Nov 2025 11:37:07 -0800 Subject: [PATCH 1/8] Ensure hosting tab ignores location filters --- src/pages/BrowseMatchesPage.tsx | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/pages/BrowseMatchesPage.tsx b/src/pages/BrowseMatchesPage.tsx index 52ffa02d..1cd93722 100644 --- a/src/pages/BrowseMatchesPage.tsx +++ b/src/pages/BrowseMatchesPage.tsx @@ -336,15 +336,19 @@ const BrowseMatchesPage = () => { })(); const perPage = isHostingTab ? 50 : 20; + const latitude = isHostingTab ? undefined : position?.latitude; + const longitude = isHostingTab ? undefined : position?.longitude; + const distance = isHostingTab ? undefined : distanceMiles; + try { const token = getStoredAuthToken({ preferScheme: "Token" }); const response = await listMatches({ page: 1, perPage, search: searchQuery || undefined, - distance: Number.isFinite(distanceMiles) ? distanceMiles : undefined, - latitude: position?.latitude, - longitude: position?.longitude, + distance: Number.isFinite(distance) ? distance : undefined, + latitude, + longitude, ...tabFilters, token: token ?? undefined, signal, From f481766a3b898a78204599e01b1f00e5117272e6 Mon Sep 17 00:00:00 2001 From: Studio-18 Date: Wed, 19 Nov 2025 11:52:15 -0800 Subject: [PATCH 2/8] Fix hosting filter to ignore location search --- src/pages/BrowseMatchesPage.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/pages/BrowseMatchesPage.tsx b/src/pages/BrowseMatchesPage.tsx index 1cd93722..2648b98f 100644 --- a/src/pages/BrowseMatchesPage.tsx +++ b/src/pages/BrowseMatchesPage.tsx @@ -323,9 +323,11 @@ const BrowseMatchesPage = () => { setIsLoadingMatches(true); setMatchesError(null); - const distanceMiles = parseDistanceMiles(selectedDistance); - const searchQuery = (appliedSearch || locationQuery).trim(); const isHostingTab = selectedTab === "Hosting"; + const distanceMiles = parseDistanceMiles(selectedDistance); + const searchQuery = ( + isHostingTab ? appliedSearch : appliedSearch || locationQuery + ).trim(); const tabFilters = (() => { if (selectedTab === "My Matches") return { filter: "my" as const }; if (isHostingTab) return { filter: "my" as const, includeHidden: true }; From fe060bfadbcaa0425f8f59fceddf5090af6b8996 Mon Sep 17 00:00:00 2001 From: Studio-18 Date: Wed, 19 Nov 2025 13:27:29 -0800 Subject: [PATCH 3/8] Fix hosting filter query parameters --- src/pages/BrowseMatchesPage.tsx | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/pages/BrowseMatchesPage.tsx b/src/pages/BrowseMatchesPage.tsx index 2648b98f..1a4c98d3 100644 --- a/src/pages/BrowseMatchesPage.tsx +++ b/src/pages/BrowseMatchesPage.tsx @@ -325,22 +325,23 @@ const BrowseMatchesPage = () => { const isHostingTab = selectedTab === "Hosting"; const distanceMiles = parseDistanceMiles(selectedDistance); - const searchQuery = ( - isHostingTab ? appliedSearch : appliedSearch || locationQuery - ).trim(); + const searchQuery = (appliedSearch || locationQuery).trim(); const tabFilters = (() => { if (selectedTab === "My Matches") return { filter: "my" as const }; - if (isHostingTab) return { filter: "my" as const, includeHidden: true }; + if (isHostingTab) + return { filter: "my" as const, includeHidden: true, include_hidden: true }; if (selectedTab === "Open") return { status: "open" as const }; - if (selectedTab === "Drafts") return { status: "draft" as const, includeHidden: true }; - if (selectedTab === "Archived") return { status: "archived" as const, includeHidden: true }; + if (selectedTab === "Drafts") + return { status: "draft" as const, includeHidden: true, include_hidden: true }; + if (selectedTab === "Archived") + return { filter: "archieve" as const, includeHidden: true, include_hidden: true }; return {}; })(); const perPage = isHostingTab ? 50 : 20; - const latitude = isHostingTab ? undefined : position?.latitude; - const longitude = isHostingTab ? undefined : position?.longitude; - const distance = isHostingTab ? undefined : distanceMiles; + const latitude = position?.latitude; + const longitude = position?.longitude; + const distance = Number.isFinite(distanceMiles) ? distanceMiles : undefined; try { const token = getStoredAuthToken({ preferScheme: "Token" }); From bbdbf30f95f75066f169c2be2646f22f07d034be Mon Sep 17 00:00:00 2001 From: Studio-18 Date: Wed, 19 Nov 2025 13:33:50 -0800 Subject: [PATCH 4/8] Stop applying location filters to hosting tab --- src/pages/BrowseMatchesPage.tsx | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/pages/BrowseMatchesPage.tsx b/src/pages/BrowseMatchesPage.tsx index 1a4c98d3..a3494be2 100644 --- a/src/pages/BrowseMatchesPage.tsx +++ b/src/pages/BrowseMatchesPage.tsx @@ -325,7 +325,7 @@ const BrowseMatchesPage = () => { const isHostingTab = selectedTab === "Hosting"; const distanceMiles = parseDistanceMiles(selectedDistance); - const searchQuery = (appliedSearch || locationQuery).trim(); + const searchQuery = (isHostingTab ? appliedSearch : appliedSearch || locationQuery).trim(); const tabFilters = (() => { if (selectedTab === "My Matches") return { filter: "my" as const }; if (isHostingTab) @@ -339,9 +339,12 @@ const BrowseMatchesPage = () => { })(); const perPage = isHostingTab ? 50 : 20; - const latitude = position?.latitude; - const longitude = position?.longitude; - const distance = Number.isFinite(distanceMiles) ? distanceMiles : undefined; + const hasCoords = + typeof position?.latitude === "number" && typeof position?.longitude === "number"; + const latitude = isHostingTab ? undefined : position?.latitude; + const longitude = isHostingTab ? undefined : position?.longitude; + const distance = + isHostingTab || !hasCoords || !Number.isFinite(distanceMiles) ? undefined : distanceMiles; try { const token = getStoredAuthToken({ preferScheme: "Token" }); From 97c6e8f9b499b8475fe60a3e84077220f0d9158a Mon Sep 17 00:00:00 2001 From: Studio-18 Date: Wed, 19 Nov 2025 13:50:39 -0800 Subject: [PATCH 5/8] Stop filtering hosting tab results client-side --- src/pages/BrowseMatchesPage.tsx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/pages/BrowseMatchesPage.tsx b/src/pages/BrowseMatchesPage.tsx index a3494be2..1bdf17b3 100644 --- a/src/pages/BrowseMatchesPage.tsx +++ b/src/pages/BrowseMatchesPage.tsx @@ -361,10 +361,7 @@ const BrowseMatchesPage = () => { }); const normalized = response.matches.map((match) => normalizeMatchRecord(match, { currentUser: user })); - const filtered = isHostingTab - ? normalized.filter((match) => match.relationship === "host") - : normalized; - setMatches(filtered); + setMatches(normalized); } catch (fetchError) { if (signal.aborted) return; console.error("Failed to load matches", fetchError); From a9a174f7d9de3fd519e39dd35e615e5c7aa27463 Mon Sep 17 00:00:00 2001 From: Studio-18 Date: Wed, 19 Nov 2025 14:02:05 -0800 Subject: [PATCH 6/8] Send upcoming-only hosting filter --- src/pages/BrowseMatchesPage.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/pages/BrowseMatchesPage.tsx b/src/pages/BrowseMatchesPage.tsx index 1bdf17b3..f23b35b4 100644 --- a/src/pages/BrowseMatchesPage.tsx +++ b/src/pages/BrowseMatchesPage.tsx @@ -329,7 +329,12 @@ const BrowseMatchesPage = () => { const tabFilters = (() => { if (selectedTab === "My Matches") return { filter: "my" as const }; if (isHostingTab) - return { filter: "my" as const, includeHidden: true, include_hidden: true }; + return { + filter: "my" as const, + status: "upcoming" as const, + includeHidden: true, + include_hidden: true, + }; if (selectedTab === "Open") return { status: "open" as const }; if (selectedTab === "Drafts") return { status: "draft" as const, includeHidden: true, include_hidden: true }; From 0c759afe5a846d81578cabd6bd8b0680c4c7647a Mon Sep 17 00:00:00 2001 From: Studio-18 Date: Wed, 19 Nov 2025 14:20:46 -0800 Subject: [PATCH 7/8] Remove status constraint from hosting tab --- src/pages/BrowseMatchesPage.tsx | 1 - 1 file changed, 1 deletion(-) diff --git a/src/pages/BrowseMatchesPage.tsx b/src/pages/BrowseMatchesPage.tsx index f23b35b4..ee8f329e 100644 --- a/src/pages/BrowseMatchesPage.tsx +++ b/src/pages/BrowseMatchesPage.tsx @@ -331,7 +331,6 @@ const BrowseMatchesPage = () => { if (isHostingTab) return { filter: "my" as const, - status: "upcoming" as const, includeHidden: true, include_hidden: true, }; From 3d25075505a28e15664478705342b238f7e12e0e Mon Sep 17 00:00:00 2001 From: Studio-18 Date: Wed, 19 Nov 2025 15:20:55 -0800 Subject: [PATCH 8/8] Adjust hosting tab to show hosted matches --- src/pages/BrowseMatchesPage.tsx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/pages/BrowseMatchesPage.tsx b/src/pages/BrowseMatchesPage.tsx index ee8f329e..88548f4d 100644 --- a/src/pages/BrowseMatchesPage.tsx +++ b/src/pages/BrowseMatchesPage.tsx @@ -331,8 +331,6 @@ const BrowseMatchesPage = () => { if (isHostingTab) return { filter: "my" as const, - includeHidden: true, - include_hidden: true, }; if (selectedTab === "Open") return { status: "open" as const }; if (selectedTab === "Drafts") @@ -407,6 +405,11 @@ const BrowseMatchesPage = () => { [], ); + const visibleMatches = useMemo( + () => (selectedTab === "Hosting" ? matches.filter((match) => match.relationship === "host") : matches), + [matches, selectedTab], + ); + return (
@@ -583,7 +586,7 @@ const BrowseMatchesPage = () => {
) : ( - matches.map((match) => { + visibleMatches.map((match) => { const isHost = match.relationship === "host"; const isParticipant = match.relationship === "participant"; const playersJoined = match.playersJoined ?? 0;