mirror of
https://github.com/LBRYFoundation/lbry-desktop.git
synced 2025-08-23 17:47:24 +00:00
- Add "disable auto updates" setting (prevents downloading updates in the background but will still notify if there are newer versions) - Prevent downloading multiple times the same update - Hide nag when auto update modal is displayed
30 lines
818 B
JavaScript
30 lines
818 B
JavaScript
// @flow
|
|
import React from 'react';
|
|
import * as remote from '@electron/remote';
|
|
import { FormField } from 'component/common/form';
|
|
|
|
const { autoUpdater } = remote.require('electron-updater');
|
|
|
|
type Props = {
|
|
setClientSetting: (boolean) => void,
|
|
disableAutoUpdates: boolean,
|
|
};
|
|
function SettingDisableAutoUpdates(props: Props) {
|
|
const { setClientSetting, disableAutoUpdates } = props;
|
|
return (
|
|
<React.Fragment>
|
|
<FormField
|
|
type="checkbox"
|
|
name="autoupdates"
|
|
onChange={() => {
|
|
const newDisableAutoUpdates = !disableAutoUpdates;
|
|
autoUpdater.autoDownload = !newDisableAutoUpdates;
|
|
setClientSetting(newDisableAutoUpdates);
|
|
}}
|
|
checked={disableAutoUpdates}
|
|
/>
|
|
</React.Fragment>
|
|
);
|
|
}
|
|
|
|
export default SettingDisableAutoUpdates;
|