Skip to content

Commit

Permalink
Update General.jsx
Browse files Browse the repository at this point in the history
  • Loading branch information
hoothin committed Oct 31, 2023
1 parent 2d77a82 commit 2f5a62c
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions src/page/General.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ export default function General() {
} else if (event.target.name === "defaultFindTab") {
newPref["defaultPicker"] = !event.target.checked;
}
if (event.target.name === "disableTypeOpen" && event.target.checked) {
newPref["disableAutoOpen"] = true;
}
if (event.target.name === "disableAutoOpen" && !event.target.checked) {
newPref["disableTypeOpen"] = false;
}
setState(newPref);
window.searchData.prefConfig = newPref;
saveConfigToScript();
Expand Down Expand Up @@ -642,6 +648,8 @@ export default function General() {
/>
</FormControl>
</Box>
</Box>
<Box sx={{ flexGrow: 1, display: 'flex'}}>
<Box>
<Typography gutterBottom component="div">
<h4>{window.i18n('disableTypeOpen')}</h4>
Expand All @@ -656,6 +664,19 @@ export default function General() {
/>
</FormControl>
</Box>
<Box>
<Typography gutterBottom component="div">
<h4>{window.i18n('disableAutoOpen')}</h4>
</Typography>
<FormControl sx={{ m: 1, minWidth: 80 }}>
<FormControlLabel
control={
<Switch checked={state.disableAutoOpen} onChange={handleCheckChange} name="disableAutoOpen" />
}
label={window.i18n('disableAutoOpenTips')}
/>
</FormControl>
</Box>
</Box>
</Paper>
<Paper elevation={5} sx={{ padding: '20px', marginTop: '20px' }}>
Expand Down Expand Up @@ -864,19 +885,6 @@ export default function General() {
</Paper>
<Paper elevation={5} sx={{ padding: '20px', marginTop: '20px' }}>
<Box sx={{ flexGrow: 1, display: 'flex'}}>
<Box>
<Typography gutterBottom component="div">
<h4>{window.i18n('disableAutoOpen')}</h4>
</Typography>
<FormControl sx={{ m: 1, minWidth: 80 }}>
<FormControlLabel
control={
<Switch checked={state.disableAutoOpen} onChange={handleCheckChange} name="disableAutoOpen" />
}
label={window.i18n('disableAutoOpenTips')}
/>
</FormControl>
</Box>
<Box>
<Typography gutterBottom component="div">
<h4>{window.i18n('hideOnSearchEngine')}</h4>
Expand Down

0 comments on commit 2f5a62c

Please sign in to comment.