fix: hide tips when folder trust dialog is open (#7394)

Co-authored-by: Hriday Taneja <hridayt@google.com>
Co-authored-by: Abhi <43648792+abhipatel12@users.noreply.github.com>
This commit is contained in:
hritan
2025-09-08 16:41:39 +00:00
committed by GitHub
parent 1788f04f5c
commit 78142eab55
4 changed files with 53 additions and 16 deletions
@@ -19,6 +19,7 @@ export const useFolderTrust = (
settings: LoadedSettings,
config: Config,
onTrustChange: (isTrusted: boolean | undefined) => void,
refreshStatic: () => void,
) => {
const [isTrusted, setIsTrusted] = useState<boolean | undefined>(undefined);
const [isFolderTrustDialogOpen, setIsFolderTrustDialogOpen] = useState(false);
@@ -33,6 +34,12 @@ export const useFolderTrust = (
onTrustChange(trusted);
}, [folderTrust, onTrustChange, settings.merged]);
useEffect(() => {
// When the folder trust dialog is about to open/close, we need to force a refresh
// of the static content to ensure the Tips are hidden/shown correctly.
refreshStatic();
}, [isFolderTrustDialogOpen, refreshStatic]);
const handleFolderTrustSelect = useCallback(
(choice: FolderTrustChoice) => {
const trustedFolders = loadTrustedFolders();