Skip to content

Commit 06b174a

Browse files
committed
Merge branch 'dev'
2 parents 929ab33 + 62e7046 commit 06b174a

File tree

6 files changed

+21
-11
lines changed

6 files changed

+21
-11
lines changed

kleros-app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@kleros/kleros-app",
3-
"version": "2.0.2",
3+
"version": "2.1.0",
44
"description": "Library for Kleros DApps with reusable abstractions and components.",
55
"repository": "[email protected]:kleros/kleros-v2.git",
66
"homepage": "https://github.com/kleros/kleros-v2/tree/master/kleros-app#readme",

web/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@
124124
"react-toastify": "^9.1.3",
125125
"react-use": "^17.5.1",
126126
"styled-components": "^5.3.3",
127-
"subgraph-status": "^1.2.3",
127+
"subgraph-status": "^1.2.4",
128128
"viem": "^2.21.54",
129129
"wagmi": "^2.14.10"
130130
}

web/src/components/Popup/index.tsx

+3
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ const Popup: React.FC<PopupProps & IPopup> = ({
239239
const closePopup = () => {
240240
setIsOpen(false);
241241
resetValue();
242+
// dispute data is cleared, so if popup is closed the preview will show empty,
243+
// instead redirect to start point.
244+
if (popupType === PopupType.DISPUTE_CREATED) navigate("/resolver");
242245
};
243246

244247
return (

web/src/context/NewDisputeContext.tsx

+6-3
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ interface INewDisputeContext {
6060
setIsPolicyUploading: (isPolicyUploading: boolean) => void;
6161
}
6262

63-
const initialDisputeData: IDisputeData = {
63+
const getInitialDisputeData = (): IDisputeData => ({
6464
numberOfJurors: 3,
6565
title: "",
6666
description: "",
@@ -72,7 +72,9 @@ const initialDisputeData: IDisputeData = {
7272
],
7373
aliasesArray: [{ name: "", address: "", id: "1" }],
7474
version: "1.0",
75-
};
75+
});
76+
77+
const initialDisputeData = getInitialDisputeData();
7678

7779
const NewDisputeContext = createContext<INewDisputeContext | undefined>(undefined);
7880

@@ -92,7 +94,8 @@ export const NewDisputeProvider: React.FC<{ children: React.ReactNode }> = ({ ch
9294
const disputeTemplate = useMemo(() => constructDisputeTemplate(disputeData), [disputeData]);
9395

9496
const resetDisputeData = useCallback(() => {
95-
setDisputeData(initialDisputeData);
97+
const freshData = getInitialDisputeData();
98+
setDisputeData(freshData);
9699
}, [setDisputeData]);
97100

98101
const contextValues = useMemo(

web/src/pages/Resolver/index.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
import React from "react";
1+
import React, { useEffect } from "react";
22
import styled, { css } from "styled-components";
33

44
import { Navigate, Route, Routes, useLocation } from "react-router-dom";
55
import { useToggle } from "react-use";
66
import { useAccount } from "wagmi";
77

8+
import { useNewDisputeContext } from "context/NewDisputeContext";
9+
810
import { MAX_WIDTH_LANDSCAPE, landscapeStyle } from "styles/landscapeStyle";
911
import { responsiveSize } from "styles/responsiveSize";
1012

@@ -79,7 +81,9 @@ const DisputeResolver: React.FC = () => {
7981
const [isDisputeResolverMiniGuideOpen, toggleDisputeResolverMiniGuide] = useToggle(false);
8082
const { isConnected } = useAccount();
8183
const isPreviewPage = location.pathname.includes("/preview");
84+
const { resetDisputeData } = useNewDisputeContext();
8285

86+
useEffect(() => resetDisputeData(), []);
8387
return (
8488
<Wrapper>
8589
<HeroImage />

yarn.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -5700,7 +5700,7 @@ __metadata:
57005700
react-use: "npm:^17.5.1"
57015701
rimraf: "npm:^6.0.1"
57025702
styled-components: "npm:^5.3.3"
5703-
subgraph-status: "npm:^1.2.3"
5703+
subgraph-status: "npm:^1.2.4"
57045704
typescript: "npm:^5.6.3"
57055705
viem: "npm:^2.21.54"
57065706
vite: "npm:^5.4.11"
@@ -31647,9 +31647,9 @@ __metadata:
3164731647
languageName: node
3164831648
linkType: hard
3164931649

31650-
"subgraph-status@npm:^1.2.3":
31651-
version: 1.2.3
31652-
resolution: "subgraph-status@npm:1.2.3"
31650+
"subgraph-status@npm:^1.2.4":
31651+
version: 1.2.4
31652+
resolution: "subgraph-status@npm:1.2.4"
3165331653
dependencies:
3165431654
react-slick: "npm:^0.30.2"
3165531655
slick-carousel: "npm:^1.8.1"
@@ -31659,7 +31659,7 @@ __metadata:
3165931659
"@types/react-dom": ^18.3.0
3166031660
react: ^18.3.1
3166131661
react-dom: ^18.3.1
31662-
checksum: 10/a125ec618073493026a29e9120a1fc73f8a3ad36b24815fe2f4ecd65f8cefa8b19d5bc072ee3f9b72172436c783fc918f6f13b396dddb935c5e70a3bd748888d
31662+
checksum: 10/8088ec7440f5d2811fae8b6520f531c60f41a786384a874005646240d22570601a359e5681912ae125aa81e1208f9e2e7c359ca1c81ab92363bbf27688b880bb
3166331663
languageName: node
3166431664
linkType: hard
3166531665

0 commit comments

Comments
 (0)