settings: add option to disable auto check updates (#279)

This commit is contained in:
Huang Xin
2025-02-01 13:45:55 +01:00
committed by GitHub
parent 44885f2901
commit 6889d6341f
26 changed files with 131 additions and 37 deletions
+8 -4
View File
@@ -5,20 +5,24 @@ import { useTheme } from '@/hooks/useTheme';
import { hasUpdater } from '@/services/environment';
import { checkForAppUpdates } from '@/helpers/updater';
import { useTranslation } from '@/hooks/useTranslation';
import { useSettingsStore } from '@/store/settingsStore';
import Reader from './components/Reader';
export default function Page() {
const _ = useTranslation();
const { settings } = useSettingsStore();
useTheme();
useEffect(() => {
const doAppUpdates = async () => {
if (hasUpdater()) {
const doCheckAppUpdates = async () => {
if (hasUpdater() && settings.autoCheckUpdates) {
await checkForAppUpdates(_);
}
};
doAppUpdates();
doCheckAppUpdates();
// eslint-disable-next-line react-hooks/exhaustive-deps
}, []);
}, [settings]);
return <Reader />;
}