From 6c177a3994067e9f13fa03b01e9379c1e159ce63 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Ortiz karliatto Date: Mon, 2 Dec 2024 13:15:10 +0100 Subject: [PATCH] fixup! feat(suite-desktop-core): support external Tor --- packages/suite-desktop-core/src/modules/tor.ts | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/packages/suite-desktop-core/src/modules/tor.ts b/packages/suite-desktop-core/src/modules/tor.ts index 547f6b2fdf38..d9b8bd5449d0 100644 --- a/packages/suite-desktop-core/src/modules/tor.ts +++ b/packages/suite-desktop-core/src/modules/tor.ts @@ -30,10 +30,10 @@ const load = async ({ mainWindowProxy, store, mainThreadEmitter }: Dependencies) const settings = store.getTorSettings(); - const implementations = [ + const processes = [ { type: 'tor', - impl: new TorProcess({ + process: new TorProcess({ host: settings.host, port: settings.port, controlPort: settings.controlPort, @@ -43,14 +43,14 @@ const load = async ({ mainWindowProxy, store, mainThreadEmitter }: Dependencies) }, { type: 'tor-external', - impl: new TorExternalProcess(), + process: new TorExternalProcess(), }, ]; const getTarget = () => { const { useExternalTor } = store.getTorSettings(); const currentTarget = useExternalTor ? 'tor-external' : 'tor'; - return implementations.find(impl => impl.type === currentTarget)!.impl; + return processes.find(process => process.type === currentTarget)!.process; }; const updateTorPort = (port: number) => { @@ -120,8 +120,9 @@ const load = async ({ mainWindowProxy, store, mainThreadEmitter }: Dependencies) const createFakeBootstrapProcess = () => { let progress = 0; - const duration = 3 * 1000; // 3 seconds. - const interval = 300; // update progress every 300ms + const duration = 3_000; + // update progress every 300ms. + const interval = 300; const increment = (100 / duration) * interval; const intervalId = setInterval(() => {