feat(auto-update): improve auto-update toggle functionality (#5215)
* feat(auto-update): improve auto-update toggle functionality - Added setAutoUpdate method in AppUpdater to control auto-update behavior. - Updated IPC handler to set auto-update status based on user preference. - Modified AboutSettings component to conditionally display update options based on auto-check setting. * update autoupdate position
This commit is contained in:
parent
4fe99cddce
commit
7fb6eb1949
@ -104,6 +104,7 @@ export function registerIpc(mainWindow: BrowserWindow, app: Electron.App) {
|
|||||||
|
|
||||||
// auto update
|
// auto update
|
||||||
ipcMain.handle(IpcChannel.App_SetAutoUpdate, (_, isActive: boolean) => {
|
ipcMain.handle(IpcChannel.App_SetAutoUpdate, (_, isActive: boolean) => {
|
||||||
|
appUpdater.setAutoUpdate(isActive)
|
||||||
configManager.setAutoUpdate(isActive)
|
configManager.setAutoUpdate(isActive)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
@ -55,6 +55,11 @@ export default class AppUpdater {
|
|||||||
this.autoUpdater = autoUpdater
|
this.autoUpdater = autoUpdater
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public setAutoUpdate(isActive: boolean) {
|
||||||
|
autoUpdater.autoDownload = isActive
|
||||||
|
autoUpdater.autoInstallOnAppQuit = isActive
|
||||||
|
}
|
||||||
|
|
||||||
public async showUpdateDialog(mainWindow: BrowserWindow) {
|
public async showUpdateDialog(mainWindow: BrowserWindow) {
|
||||||
if (!this.releaseInfo) {
|
if (!this.releaseInfo) {
|
||||||
return
|
return
|
||||||
|
|||||||
@ -168,7 +168,7 @@ const AboutSettings: FC = () => {
|
|||||||
</>
|
</>
|
||||||
)}
|
)}
|
||||||
</SettingGroup>
|
</SettingGroup>
|
||||||
{hasNewVersion && update.info && (
|
{autoCheckUpdate && hasNewVersion && update.info && (
|
||||||
<SettingGroup theme={theme}>
|
<SettingGroup theme={theme}>
|
||||||
<SettingRow>
|
<SettingRow>
|
||||||
<SettingRowTitle>
|
<SettingRowTitle>
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user