From c2509e860752e23812bb408e331c02c918aadd54 Mon Sep 17 00:00:00 2001 From: André Oliveira <37463445+SpecialAro@users.noreply.github.com> Date: Thu, 4 Aug 2022 00:12:03 +0100 Subject: chore: change values inside mobx actions to fix console warnings (#532) --- src/features/serviceProxy/index.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/features/serviceProxy') diff --git a/src/features/serviceProxy/index.ts b/src/features/serviceProxy/index.ts index 51e67feca..eb3b89ece 100644 --- a/src/features/serviceProxy/index.ts +++ b/src/features/serviceProxy/index.ts @@ -1,4 +1,4 @@ -import { autorun, observable } from 'mobx'; +import { autorun, action, observable } from 'mobx'; import { session } from '@electron/remote'; const debug = require('../../preload-safe-debug')( @@ -15,8 +15,12 @@ export default function init(stores: { }) { debug('Initializing `serviceProxy` feature'); + const setIsEnabled = action((value: boolean) => { + config.isEnabled = value; + }); + autorun(() => { - config.isEnabled = true; + setIsEnabled(true); const services = stores.services.enabled; const proxySettings = stores.settings.proxy; -- cgit v1.2.3-54-g00ecf