@@ -11,8 +11,9 @@ import { prepareArbitratorExtradata } from "utils/prepareArbitratorExtradata";
11
11
import { usePublicClient } from "wagmi" ;
12
12
import Popup , { PopupType } from "components/Popup" ;
13
13
import DisputeIcon from "assets/svgs/icons/dispute.svg" ;
14
- import { DecodeEventLogParameters , decodeEventLog , parseAbi } from "viem" ;
14
+ import { Log , decodeEventLog , parseAbi } from "viem" ;
15
15
import { EnsureChain } from "components/EnsureChain" ;
16
+ import { isUndefined } from "utils/index" ;
16
17
17
18
const StyledButton = styled ( Button ) `` ;
18
19
@@ -56,14 +57,13 @@ const SubmitDisputeButton: React.FC = () => {
56
57
setIsSubmittingCase ( true ) ;
57
58
wrapWithToast ( async ( ) => await submitCase ( ) . then ( ( response ) => response . hash ) , publicClient )
58
59
. then ( ( res ) => {
59
- if ( res . status === "success" ) {
60
- const id = retrieveDisputeId ( res . logs [ 1 ] ) ;
60
+ if ( res . status && ! isUndefined ( res . result ) ) {
61
+ const id = retrieveDisputeId ( res . result . logs [ 1 ] ) ;
61
62
setDisputeId ( Number ( id ) ) ;
62
63
setCourtId ( disputeData . courtId ?? "1" ) ;
63
64
setIsPopupOpen ( true ) ;
65
+ resetDisputeData ( ) ;
64
66
}
65
-
66
- resetDisputeData ( ) ;
67
67
} )
68
68
. finally ( ( ) => {
69
69
setIsSubmittingCase ( false ) ;
@@ -96,7 +96,7 @@ const isTemplateValid = (disputeTemplate: IDisputeTemplate) => {
96
96
areVotingOptionsFilled ) as boolean ;
97
97
} ;
98
98
99
- const retrieveDisputeId = ( eventLog : DecodeEventLogParameters ) =>
99
+ const retrieveDisputeId = ( eventLog : Log ) =>
100
100
decodeEventLog ( {
101
101
abi : parseAbi ( [ "event DisputeCreation(uint256 indexed, address indexed)" ] ) ,
102
102
data : eventLog . data ,
0 commit comments