Skip to content

TagSpaces is an offline, open source, document manager with tagging support

chore: stop reload on focus in search results

Ilian Sapundshiev8e8f45b7a735
diff --git a/src/renderer/perspectives/common/useReloadOnFocus.ts b/src/renderer/perspectives/common/useReloadOnFocus.ts
index bf37b8f9a..8f9d5bbd4 100644
--- a/src/renderer/perspectives/common/useReloadOnFocus.ts
+++ b/src/renderer/perspectives/common/useReloadOnFocus.ts
@@ -1,3 +1,4 @@
+import { useDirectoryContentContext } from '-/hooks/useDirectoryContentContext';
import { useEffect, useRef } from 'react';
/**
@@ -11,6 +12,7 @@ export function useReloadOnFocus(
): void {
const lastLoadRef = useRef<number>(Date.now());
const reloadTimeout = 15000;
+ const { isSearchMode } = useDirectoryContentContext();
function throttledLoad() {
const now = Date.now();
@@ -24,6 +26,7 @@ export function useReloadOnFocus(
useEffect(() => {
if (!reloadOnFocus) return;
+ if (isSearchMode) return;
const handleVisibilityChange = () => {
if (document.visibilityState === 'visible') {