Skip to content

Commit

Permalink
add link to register/ edit drep and create GA
Browse files Browse the repository at this point in the history
  • Loading branch information
Sworzen1 committed Jun 11, 2024
1 parent 854ab5c commit acbc83f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,10 +162,11 @@ export const useCreateGovernanceActionForm = (
[hash],
);

const showSuccessModal = useCallback(() => {
const showSuccessModal = useCallback((link: string) => {
openModal({
type: "statusModal",
state: {
link: `https://sancho.cexplorer.io/tx/${link}`,
status: "success",
title: t(
"createGovernanceAction.modals.submitTransactionSuccess.title",
Expand Down Expand Up @@ -208,12 +209,12 @@ export const useCreateGovernanceActionForm = (
}

const govActionBuilder = await buildTransaction(data);
await buildSignSubmitConwayCertTx({
const result = await buildSignSubmitConwayCertTx({
govActionBuilder,
type: "createGovAction",
});

showSuccessModal();
if (result) showSuccessModal(result);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
const isInsufficientBalance = error
Expand Down
7 changes: 4 additions & 3 deletions govtool/frontend/src/hooks/forms/useEditDRepInfoForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,11 @@ export const useEditDRepInfoForm = (
});
}, []);

const showSuccessModal = useCallback(() => {
const showSuccessModal = useCallback((link: string) => {
openModal({
type: "statusModal",
state: {
link: `https://sancho.cexplorer.io/tx/${link}`,
status: "success",
title: t("modals.registration.title"),
message: t("modals.registration.message"),
Expand Down Expand Up @@ -156,12 +157,12 @@ export const useEditDRepInfoForm = (
}

const updateDRepMetadataCert = await buildDRepUpdateCert(url, hash);
await buildSignSubmitConwayCertTx({
const result = await buildSignSubmitConwayCertTx({
certBuilder: updateDRepMetadataCert,
type: "updateMetaData",
});

showSuccessModal();
if (result) showSuccessModal(result);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
if (Object.values(MetadataValidationStatus).includes(error)) {
Expand Down
7 changes: 4 additions & 3 deletions govtool/frontend/src/hooks/forms/useRegisterAsdRepForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -159,10 +159,11 @@ export const useRegisterAsdRepForm = (
});
}, []);

const showSuccessModal = useCallback(() => {
const showSuccessModal = useCallback((link: string) => {
openModal({
type: "statusModal",
state: {
link: `https://sancho.cexplorer.io/tx/${link}`,
status: "success",
title: t("modals.registration.title"),
message: t("modals.registration.message"),
Expand Down Expand Up @@ -191,12 +192,12 @@ export const useRegisterAsdRepForm = (
throw status;
}
const registerAsDRepCert = await createRegistrationCert(data);
await buildSignSubmitConwayCertTx({
const result = await buildSignSubmitConwayCertTx({
certBuilder: registerAsDRepCert,
type: "registerAsDrep",
});

showSuccessModal();
if (result) showSuccessModal(result);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
} catch (error: any) {
if (Object.values(MetadataValidationStatus).includes(error)) {
Expand Down

0 comments on commit acbc83f

Please sign in to comment.