feat: adding optional common redist install

This commit is contained in:
Chubby Granny Chaser
2025-04-06 22:17:54 +01:00
parent 1520e2b2ae
commit f8ea4f29d9
5 changed files with 18 additions and 7 deletions

View File

@@ -237,7 +237,7 @@ declare global {
canInstallCommonRedist: () => Promise<boolean>;
installCommonRedist: () => Promise<void>;
onCommonRedistProgress: (
cb: (value: { component: string; complete: boolean }) => void
cb: (value: { log: string; complete: boolean }) => void
) => () => Electron.IpcRenderer;
platform: NodeJS.Platform;

View File

@@ -54,6 +54,12 @@ export function SettingsGeneral() {
setCanInstallCommonRedist(canInstall);
});
const interval = setInterval(() => {
window.electron.canInstallCommonRedist().then((canInstall) => {
setCanInstallCommonRedist(canInstall);
});
}, 1000 * 5);
setLanguageOptions(
orderBy(
Object.entries(languageResources).map(([language, value]) => {
@@ -66,6 +72,10 @@ export function SettingsGeneral() {
"asc"
)
);
return () => {
clearInterval(interval);
};
}, []);
useEffect(() => {