fix(ui): search results, navigation and window controls on headers
Continuous Integration / build_web (push) Failing after 0s
Continuous Integration / build (macos-latest) (push) Skipped
Continuous Integration / build (ubuntu-22.04) (push) Skipped
Continuous Integration / build (windows-11-arm) (push) Skipped
Continuous Integration / build (windows-latest) (push) Skipped
Continuous Integration / nightly_release (push) Skipped

Search queries no longer cache empty results while auth is restoring, the search header gets a working navigation drawer, and library/search headers include the custom window controls on Windows/Linux. Idle remote-session polling is reduced.
This commit is contained in:
1xDed committed 2026-11-28 02:14:47 +03:00
1 parent 3cfa52ffc9
commit 23cdfb010d
4 files changed
+54 -23

No files matched your search

@@ -84,6 +84,7 @@ const AudioPlayer = () => {
const [playing, setPlaying] = useState(false);
const [progress, setProgress] = useState(0);
const [selectedRemoteId, setSelectedRemoteId] = useState<string | null>(null);
const remoteActiveRef = useRef(false);
const [moreAnchor, setMoreAnchor] = useState<HTMLElement | null>(null);
const [remoteVolumeDraft, setRemoteVolumeDraft] = useState<number | null>(
null,
@@ -98,9 +99,12 @@ const AudioPlayer = () => {
return result.data;
},
enabled: !!api && !!user?.Id,
// Do not keep polling the server while the window is hidden.
refetchInterval: () =>
document.visibilityState === "visible" ? 3000 : false,
// Poll quickly only while something is actually playing; idle devices
// are checked less often, and never while the window is hidden.
refetchInterval: () => {
if (document.visibilityState !== "visible") return false;
return display || remoteActiveRef.current ? 3000 : 8000;
},
refetchIntervalInBackground: false,
staleTime: 1500,
networkMode: "always",
@@ -126,6 +130,7 @@ const AudioPlayer = () => {
: !display
? playingRemote
: undefined;
remoteActiveRef.current = Boolean(remote);
const activeItem: BaseItemDto | undefined | null =
remote?.NowPlayingItem ?? item;