feat: add webpush and sadhna tracker
This commit is contained in:
@@ -66,12 +66,10 @@ export function SearchFiltersMenu({
|
||||
// active count is one OR the other — never their sum.
|
||||
const activeCount = isUserChipActive ? 1 : selectedTypes.size;
|
||||
|
||||
// Desktop popover positioning — below the trigger, left-aligned.
|
||||
// Desktop popover positioning — below the trigger, left-aligned. (Stale
|
||||
// pos while closed is harmless — the popover only renders when open.)
|
||||
useEffect(() => {
|
||||
if (!open || isMobile) {
|
||||
setPos(null);
|
||||
return;
|
||||
}
|
||||
if (!open || isMobile) return;
|
||||
function recompute() {
|
||||
const btn = triggerRef.current;
|
||||
if (!btn) return;
|
||||
|
||||
@@ -283,6 +283,12 @@ function SearchInner() {
|
||||
// Fetch search results — branches between user search (`@`-prefixed)
|
||||
// and content search. We clear the *other* state slot on every run
|
||||
// so the UI doesn't show stale results from a previous mode.
|
||||
//
|
||||
// This effect synchronizes results with the debounced query; the
|
||||
// synchronous "show loading + clear stale" updates are intentional (they
|
||||
// prevent flashing previous results), so set-state-in-effect is disabled
|
||||
// for this block.
|
||||
/* eslint-disable react-hooks/set-state-in-effect */
|
||||
useEffect(() => {
|
||||
const query = debouncedQuery.trim();
|
||||
|
||||
@@ -363,6 +369,7 @@ function SearchInner() {
|
||||
isUserQueryEmpty,
|
||||
userQuery,
|
||||
]);
|
||||
/* eslint-enable react-hooks/set-state-in-effect */
|
||||
|
||||
// Auto-focus the input on mount
|
||||
useEffect(() => {
|
||||
@@ -404,11 +411,6 @@ function SearchInner() {
|
||||
}
|
||||
};
|
||||
|
||||
const isTypeActive = (type: string): boolean => {
|
||||
if (type === "all") return selectedTypes.size === 0;
|
||||
return selectedTypes.has(type);
|
||||
};
|
||||
|
||||
const handlePageChange = (page: number) => {
|
||||
setCurrentPage(page);
|
||||
window.scrollTo({ top: 0, behavior: "smooth" });
|
||||
|
||||
Reference in New Issue
Block a user