fix: fixing merge conflicts

This commit is contained in:
Dipin Jagadish 2023-10-15 20:19:08 +01:00
parent 955fcb795d
commit 0e1869139b
2 changed files with 23 additions and 23 deletions

View File

@ -15,7 +15,8 @@ const General = ({ close }) => {
savePreferences({
...preferences,
request: {
sslVerification
sslVerification,
timeout
}
})
).then(() => {
@ -24,37 +25,34 @@ const General = ({ close }) => {
};
const handleTimeoutChange = (value) => {
const timeout = value === '' ? 0 : value;
const updatedPreferences = {
...preferences,
request: {
...preferences.request,
timeout
}
};
setPreferences(updatedPreferences)
.then(() => {
setTimeout(timeout);
})
.catch((err) => {
console.error(err);
});
const validTimeout = isNaN(Number(value)) ? timeout : Number(value);
setTimeout(validTimeout);
};
return (
<StyledWrapper>
<div className="flex items-center mt-2">
<label className="mr-2" style={{ minWidth: 200 }} htmlFor="ssl-cert-verification">
SSL Certificate Verification
</label>
<input
id="ssl-verification"
id="ssl-cert-verification"
type="checkbox"
checked={sslVerification}
onChange={() => setSslVerification(!sslVerification)}
className="mr-3 mousetrap"
className="mousetrap h-4 w-4 mr-0"
/>
<label htmlFor="ssl-verification" className="select-none">
SSL Certificate Verification
</div>
<div className="flex items-center mt-2">
<label className="mr-2" style={{ minWidth: 200 }}>
Request Timeout (in ms)
</label>
<input
value={timeout === 0 ? '' : timeout}
onChange={(e) => handleTimeoutChange(e.target.value)}
type="text"
className="block textbox w-1/6"
/>
</div>
<div className="mt-10">

View File

@ -3,7 +3,8 @@ const Store = require('electron-store');
const defaultPreferences = {
request: {
sslVerification: true
sslVerification: true,
timeout: 0
},
font: {
codeFont: 'default'
@ -12,7 +13,8 @@ const defaultPreferences = {
const preferencesSchema = Yup.object().shape({
request: Yup.object().shape({
sslVerification: Yup.boolean()
sslVerification: Yup.boolean(),
timeout: Yup.number()
}),
font: Yup.object().shape({
codeFont: Yup.string().nullable()