Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix/1076-bug-missing-link-for-tracking-registration-confirmation-in-drep-registration-confirmation-modal #1242

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading