Skip to content

Commit

Permalink
Merge pull request #1242 from IntersectMBO/fix/1076-bug-missing-link-…
Browse files Browse the repository at this point in the history
…for-tracking-registration-confirmation-in-drep-registration-confirmation-modal

fix/1076-bug-missing-link-for-tracking-registration-confirmation-in-drep-registration-confirmation-modal
  • Loading branch information
Sworzen1 authored Jun 11, 2024
2 parents 854ab5c + acbc83f commit 2b34325
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 2b34325

Please sign in to comment.