settings: add option to disable auto check updates (#279)
This commit is contained in:
@@ -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 />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user