From e6768a0f9302fb8c60aa7425f573d88958165b25 Mon Sep 17 00:00:00 2001 From: IhorCryptit Date: Thu, 23 May 2024 18:39:22 +0300 Subject: [PATCH 1/2] fix: fixed link path for main icon --- apps/web-connect/src/features/header/Header.tsx | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/apps/web-connect/src/features/header/Header.tsx b/apps/web-connect/src/features/header/Header.tsx index ea360f789..b533c83a6 100644 --- a/apps/web-connect/src/features/header/Header.tsx +++ b/apps/web-connect/src/features/header/Header.tsx @@ -1,4 +1,3 @@ -import {useNavigate} from "react-router-dom"; import {ConnectButton, ExternalLink} from "@sentry/ui"; import {useWeb3Modal} from "@web3modal/wagmi/react"; import {useAccount} from "wagmi"; @@ -8,19 +7,18 @@ import MobileNavbar from "@/features/header/MobileNavbar"; import {useState} from "react"; export function Header() { - const navigate = useNavigate(); const {open} = useWeb3Modal(); const {address} = useAccount() const [isNavbarOpened, setIsNavbarOpened] = useState(false) return (
-
navigate("/")} + href="https://xai.games/" > -
+
Date: Wed, 29 May 2024 14:53:19 +0200 Subject: [PATCH 2/2] update stopRuntime pass optional data to update json with whitelist --- .../src/features/drawer/WhitelistDrawer.tsx | 14 +++++++------- .../src/hooks/useOperatorRuntime.ts | 10 +++++++--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/apps/sentry-client-desktop/src/features/drawer/WhitelistDrawer.tsx b/apps/sentry-client-desktop/src/features/drawer/WhitelistDrawer.tsx index e3fd1b1cb..bc132e9f1 100644 --- a/apps/sentry-client-desktop/src/features/drawer/WhitelistDrawer.tsx +++ b/apps/sentry-client-desktop/src/features/drawer/WhitelistDrawer.tsx @@ -11,7 +11,7 @@ import {AiOutlineInfoCircle} from "react-icons/ai"; export function WhitelistDrawer() { const setDrawerState = useSetAtom(drawerStateAtom); const {owners, pools} = useAtomValue(chainStateAtom); - const {data, setData} = useStorage(); + const {data} = useStorage(); const [selected, setSelected] = useState([]); const {sentryRunning, stopRuntime} = useOperatorRuntime(); const {publicKey: operatorAddress} = useOperator(); @@ -82,14 +82,14 @@ export function WhitelistDrawer() { ); async function handleSubmit() { - await setData({ - ...data, - whitelistedWallets: selected, - }); - setDrawerState(null); + if (stopRuntime) { - void stopRuntime(); + void stopRuntime({ + ...data, + sentryRunning: false, + whitelistedWallets: selected, + }); } } diff --git a/apps/sentry-client-desktop/src/hooks/useOperatorRuntime.ts b/apps/sentry-client-desktop/src/hooks/useOperatorRuntime.ts index 0f9f55544..cf3ab57bb 100644 --- a/apps/sentry-client-desktop/src/hooks/useOperatorRuntime.ts +++ b/apps/sentry-client-desktop/src/hooks/useOperatorRuntime.ts @@ -2,7 +2,7 @@ import {Challenge, NodeLicenseInformation, NodeLicenseStatusMap, operatorRuntime import {useOperator} from "@/features/operator"; import {atom, useAtom} from "jotai"; import {useEffect, useRef, useState} from "react"; -import {useStorage} from "@/features/storage"; +import {IData, useStorage} from "@/features/storage"; import log from "electron-log"; import { ethers } from "ethers"; @@ -70,7 +70,7 @@ export function useOperatorRuntime() { } } - async function stopRuntime() { + async function stopRuntime(passedData?: IData) { if (sentryRunning && stop !== undefined) { // prevent race conditions from pressing "stop" too fast const _stop = stop; @@ -79,7 +79,11 @@ export function useOperatorRuntime() { await _stop(); setNodeLicenseStatusMap(new Map()); setSentryRunning(false); - await setData({...data, sentryRunning: false}); + if (passedData) { + await setData(passedData); + } else { + await setData({...data, sentryRunning: false}); + } } }