Skip to content

Commit 4a27ad3

Browse files
Merge pull request #164 from xai-foundation/develop
Develop
2 parents 13d9d78 + a9b329b commit 4a27ad3

File tree

3 files changed

+17
-15
lines changed

3 files changed

+17
-15
lines changed

apps/sentry-client-desktop/src/features/drawer/WhitelistDrawer.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import {AiOutlineInfoCircle} from "react-icons/ai";
1111
export function WhitelistDrawer() {
1212
const setDrawerState = useSetAtom(drawerStateAtom);
1313
const {owners, pools} = useAtomValue(chainStateAtom);
14-
const {data, setData} = useStorage();
14+
const {data} = useStorage();
1515
const [selected, setSelected] = useState<string[]>([]);
1616
const {sentryRunning, stopRuntime} = useOperatorRuntime();
1717
const {publicKey: operatorAddress} = useOperator();
@@ -82,14 +82,14 @@ export function WhitelistDrawer() {
8282
);
8383

8484
async function handleSubmit() {
85-
await setData({
86-
...data,
87-
whitelistedWallets: selected,
88-
});
89-
9085
setDrawerState(null);
86+
9187
if (stopRuntime) {
92-
void stopRuntime();
88+
void stopRuntime({
89+
...data,
90+
sentryRunning: false,
91+
whitelistedWallets: selected,
92+
});
9393
}
9494
}
9595

apps/sentry-client-desktop/src/hooks/useOperatorRuntime.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import {Challenge, NodeLicenseInformation, NodeLicenseStatusMap, operatorRuntime
22
import {useOperator} from "@/features/operator";
33
import {atom, useAtom} from "jotai";
44
import {useEffect, useRef, useState} from "react";
5-
import {useStorage} from "@/features/storage";
5+
import {IData, useStorage} from "@/features/storage";
66
import log from "electron-log";
77
import { ethers } from "ethers";
88

@@ -70,7 +70,7 @@ export function useOperatorRuntime() {
7070
}
7171
}
7272

73-
async function stopRuntime() {
73+
async function stopRuntime(passedData?: IData) {
7474
if (sentryRunning && stop !== undefined) {
7575
// prevent race conditions from pressing "stop" too fast
7676
const _stop = stop;
@@ -79,7 +79,11 @@ export function useOperatorRuntime() {
7979
await _stop();
8080
setNodeLicenseStatusMap(new Map<bigint, NodeLicenseInformation>());
8181
setSentryRunning(false);
82-
await setData({...data, sentryRunning: false});
82+
if (passedData) {
83+
await setData(passedData);
84+
} else {
85+
await setData({...data, sentryRunning: false});
86+
}
8387
}
8488
}
8589

apps/web-connect/src/features/header/Header.tsx

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import {useNavigate} from "react-router-dom";
21
import {ConnectButton, ExternalLink} from "@sentry/ui";
32
import {useWeb3Modal} from "@web3modal/wagmi/react";
43
import {useAccount} from "wagmi";
@@ -8,19 +7,18 @@ import MobileNavbar from "@/features/header/MobileNavbar";
87
import {useState} from "react";
98

109
export function Header() {
11-
const navigate = useNavigate();
1210
const {open} = useWeb3Modal();
1311
const {address} = useAccount()
1412
const [isNavbarOpened, setIsNavbarOpened] = useState(false)
1513
return (
1614
<div className="w-full">
1715
<div className="fixed top-0 flex w-full justify-between items-center bg-transparent z-[10]">
18-
<div
16+
<a
1917
className="w-full group md:max-w-[108px] md:min-h-[108px] min-h-[64px] max-w-[64px] flex items-center bg-hornetSting justify-center hover:bg-white duration-200 ease-in cursor-pointer"
20-
onClick={() => navigate("/")}
18+
href="https://xai.games/"
2119
>
2220
<XaiLogo className="md:w-[43px] md:h-[38px] w-[26px] h-[23px] fill-white group-hover:fill-hornetSting duration-200 ease-in" />
23-
</div>
21+
</a>
2422
<div className="font-bold text-xl items-center gap-[20px] uppercase text-white hidden md:flex">
2523
<ExternalLink
2624
content={"DOCS"}

0 commit comments

Comments
 (0)