#1 PDF Application on GitHub that lets you edit PDFs on any device anywhere
TypeScript dockerhacktoberfestjavapdfpdf-converterpdf-editorpdf-manipulationpdf-mergerpdf-ocrpdf-toolspdf-web-appspdfmergerself-hosted
import { useEffect, useRef } from "react";
import { useBackendHealth } from "@editor/hooks/useBackendHealth";
import { useAppConfig } from "@editor/contexts/AppConfigContext";
/**
* Desktop-only bridge that refetches the app config once the bundled backend
* becomes healthy (and whenever it restarts). Keeps the UI responsive by using
* default config until the real config is available.
*/
export function DesktopConfigSync() {
const { status } = useBackendHealth();
const { refetch } = useAppConfig();
const previousStatus = useRef(status);
useEffect(() => {
if (status === "healthy" && previousStatus.current !== "healthy") {
refetch();
}
previousStatus.current = status;
}, [status, refetch]);
return null;
}