mirror of
https://github.com/neosubhamoy/neodlp.git
synced 2026-06-10 05:23:44 +05:30
refactor: disabled self-update check on flatpak #28
This commit is contained in:
+15
-3
@@ -307,6 +307,7 @@ export default function App({ children }: { children: React.ReactNode }) {
|
||||
|
||||
// Check for app update
|
||||
useEffect(() => {
|
||||
const handleAppUpdateCheck = async () => {
|
||||
// Only run once when both settings and KV pairs are loaded
|
||||
if (!isSettingsStatePropagated || !isKvPairsStatePropagated) {
|
||||
console.log("Skipping app update check, waiting for configs to load...");
|
||||
@@ -317,10 +318,21 @@ export default function App({ children }: { children: React.ReactNode }) {
|
||||
console.log("App update check already performed in this session, skipping");
|
||||
return;
|
||||
}
|
||||
const isFlatpak = await invoke<boolean>('is_flatpak');
|
||||
// Skip self-update check on Flatpak, as updates should be handled by Flatpak cli itself
|
||||
if (isFlatpak) {
|
||||
console.log("Flatpak detected! Skipping app update check");
|
||||
return;
|
||||
}
|
||||
|
||||
hasRunAppUpdateCheckRef.current = true;
|
||||
checkForAppUpdate().catch((error) => {
|
||||
console.error("Error checking for app update:", error);
|
||||
});
|
||||
try {
|
||||
await checkForAppUpdate();
|
||||
} catch (e) {
|
||||
console.error("Error checking for app update:", e);
|
||||
}
|
||||
}
|
||||
handleAppUpdateCheck();
|
||||
}, [isSettingsStatePropagated, isKvPairsStatePropagated]);
|
||||
|
||||
// Check for yt-dlp auto-update
|
||||
|
||||
Reference in New Issue
Block a user