From 0e1869139ba9bafe1ed0c53a1fcf2009b1f03419 Mon Sep 17 00:00:00 2001 From: Dipin Jagadish Date: Sun, 15 Oct 2023 20:19:08 +0100 Subject: [PATCH] fix: fixing merge conflicts --- .../components/Preferences/General/index.js | 40 +++++++++---------- .../bruno-electron/src/store/preferences.js | 6 ++- 2 files changed, 23 insertions(+), 23 deletions(-) diff --git a/packages/bruno-app/src/components/Preferences/General/index.js b/packages/bruno-app/src/components/Preferences/General/index.js index 1c99e545..b6719b69 100644 --- a/packages/bruno-app/src/components/Preferences/General/index.js +++ b/packages/bruno-app/src/components/Preferences/General/index.js @@ -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 (
+ setSslVerification(!sslVerification)} - className="mr-3 mousetrap" + className="mousetrap h-4 w-4 mr-0" /> -
+
+ + handleTimeoutChange(e.target.value)} + type="text" + className="block textbox w-1/6" + />
diff --git a/packages/bruno-electron/src/store/preferences.js b/packages/bruno-electron/src/store/preferences.js index 869895cd..7238ce7c 100644 --- a/packages/bruno-electron/src/store/preferences.js +++ b/packages/bruno-electron/src/store/preferences.js @@ -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()