11import React , { useEffect , useMemo } from 'react' ;
22import styles from './index.less' ;
33import i18n from '@/i18n' ;
4+ import classnames from 'classnames' ;
45import BrandLogo from '@/components/BrandLogo' ;
56import { APP_NAME , WEBSITE_DOC } from '@/constants/appConfig' ;
6- import { Button , Radio , Space } from 'antd' ;
7+ import { Button , Radio , Space , Checkbox } from 'antd' ;
78import configService from '@/service/config' ;
89import { DownloadOutlined } from '@ant-design/icons' ;
910import { IUpdateDetectionData } from '../index' ;
1011import { IUpdateDetectionRef , UpdatedStatusEnum } from '../UpdateDetection' ;
1112import Iconfont from '@/components/Iconfont' ;
13+ import { useSettingStore , setHoldingService } from '@/store/setting' ;
14+
1215interface IProps {
1316 updateDetectionData : IUpdateDetectionData | null ;
1417 updateDetectionRef : React . MutableRefObject < IUpdateDetectionRef > | null ;
@@ -19,6 +22,14 @@ export default function AboutUs(props: IProps) {
1922 const { updateDetectionData, updateDetectionRef } = props ;
2023 const [ updateRule , setUpdateRule ] = React . useState < 'manual' | 'auto' > ( updateDetectionData ?. type || 'manual' ) ;
2124
25+ const { holdingService} = useSettingStore ( ( state ) => {
26+ return {
27+ holdingService :state . holdingService
28+ }
29+ } ) ;
30+
31+ console . log ( 'holdingService' , holdingService )
32+
2233 const onChangeUpdateRul = ( e ) => {
2334 configService . setAppUpdateType ( e . target . value ) . then ( ( ) => {
2435 setUpdateRule ( e . target . value ) ;
@@ -89,6 +100,11 @@ export default function AboutUs(props: IProps) {
89100 }
90101 } , [ updateDetectionData ] ) ;
91102
103+ const changeHoldingService = ( e ) => {
104+ setHoldingService ( e . target . checked ) ;
105+ window . electronApi ?. setForceQuitCode ?.( e . target . checked ) ;
106+ }
107+
92108 return (
93109 < div className = { styles . aboutUs } >
94110 < div className = { styles . versionsInfo } >
@@ -129,6 +145,10 @@ export default function AboutUs(props: IProps) {
129145 </ Space >
130146 </ Radio . Group >
131147 </ div >
148+ < div className = { classnames ( styles . updateRule , styles . holdingService ) } >
149+ < div className = { styles . updateRuleTitle } > { i18n ( 'setting.title.holdingService' ) } </ div >
150+ < Checkbox checked = { holdingService } onChange = { changeHoldingService } > { i18n ( 'setting.text.holdingService' ) } </ Checkbox >
151+ </ div >
132152 { /* <div className={styles.brief}>
133153 <div className={styles.appName}>{APP_NAME}</div>
134154 <div className={styles.env}>
0 commit comments