@@ -2,7 +2,6 @@ import { Dispatch, SetStateAction, useCallback, useState } from "react";
22import { useNavigate } from "react-router-dom" ;
33import { useFormContext } from "react-hook-form" ;
44import { blake2bHex } from "blakejs" ;
5- import * as Sentry from "@sentry/react" ;
65import { useTranslation } from "react-i18next" ;
76import { NodeObject } from "jsonld" ;
87
@@ -129,36 +128,31 @@ export const useCreateGovernanceActionForm = (
129128 hash,
130129 url : data . storingURL ,
131130 } ;
132- try {
133- switch ( govActionType ) {
134- case GovernanceActionType . InfoAction :
135- return await buildNewInfoGovernanceAction ( commonGovActionDetails ) ;
136- case GovernanceActionType . TreasuryWithdrawals : {
137- if (
138- data . amount === undefined ||
139- data . receivingAddress === undefined
140- ) {
141- throw new Error ( t ( "errors.invalidTreasuryGovernanceActionType" ) ) ;
142- }
131+ switch ( govActionType ) {
132+ case GovernanceActionType . InfoAction :
133+ return buildNewInfoGovernanceAction ( commonGovActionDetails ) ;
134+ case GovernanceActionType . TreasuryWithdrawals : {
135+ if (
136+ data . amount === undefined ||
137+ data . receivingAddress === undefined
138+ ) {
139+ throw new Error ( t ( "errors.invalidTreasuryGovernanceActionType" ) ) ;
140+ }
143141
144- const treasuryActionDetails = {
145- ...commonGovActionDetails ,
146- withdrawals : [
147- {
148- amount : data . amount ,
149- receivingAddress : data . receivingAddress ,
150- } ,
151- ] ,
152- } ;
142+ const treasuryActionDetails = {
143+ ...commonGovActionDetails ,
144+ withdrawals : [
145+ {
146+ amount : data . amount ,
147+ receivingAddress : data . receivingAddress ,
148+ } ,
149+ ] ,
150+ } ;
153151
154- return await buildTreasuryGovernanceAction ( treasuryActionDetails ) ;
155- }
156- default :
157- throw new Error ( t ( "errors.invalidGovernanceActionType" ) ) ;
152+ return buildTreasuryGovernanceAction ( treasuryActionDetails ) ;
158153 }
159- } catch ( error ) {
160- Sentry . setTag ( "hook" , "useCreateGovernanceActionForm" ) ;
161- Sentry . captureException ( error ) ;
154+ default :
155+ throw new Error ( t ( "errors.invalidGovernanceActionType" ) ) ;
162156 }
163157 } ,
164158 [ hash ] ,
@@ -249,8 +243,6 @@ export const useCreateGovernanceActionForm = (
249243 : undefined ,
250244 dataTestId : "create-governance-action-error-modal" ,
251245 } ) ;
252- Sentry . setTag ( "hook" , "useCreateGovernanceActionForm" ) ;
253- Sentry . captureException ( error ) ;
254246 }
255247 } finally {
256248 setIsLoading ( false ) ;
0 commit comments