Skip to content

Commit

Permalink
Merge pull request #2100 from holium/fix-custom-domain
Browse files Browse the repository at this point in the history
Fix custom domain error handling
gdbroman authored Nov 6, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents 4e0115b + 1298267 commit 385acde
Showing 1 changed file with 17 additions and 19 deletions.
36 changes: 17 additions & 19 deletions hosting-holium-com/src/pages/account/custom-domain.tsx
Original file line number Diff line number Diff line change
@@ -35,25 +35,23 @@ const CustomDomainPresenter = () => {
setErrorMessage(undefined);
setSuccessMessage(undefined);

const result = await thirdEarthApi.setCustomDomain(
token,
domain,
ship.droplet_id.toString(),
ship.droplet_ip,
ship.id.toString(),
ship.user_id.toString()
);

if (result) {
if (result.checkIp !== ship.droplet_id.toString()) {
setErrorMessage(
`The domain you entered does not point to the correct IP address (${ship.droplet_ip}).`
);
} else {
setSuccessMessage(
`Your domain has been set to ${domain}. It may take a few minutes to propagate.`
);
}
try {
await thirdEarthApi.setCustomDomain(
token,
domain,
ship.droplet_id.toString(),
ship.droplet_ip,
ship.id.toString(),
ship.user_id.toString()
);
setSuccessMessage(
`Your domain has been set to ${domain}. It may take a few minutes to propagate.`
);
} catch (error) {
console.error(error);
setErrorMessage(
`The domain you entered does not point to the correct IP address (${ship.droplet_ip}).`
);
}

submitting.toggleOff();

1 comment on commit 385acde

@vercel
Copy link

@vercel vercel bot commented on 385acde Nov 6, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

hosting-holium-com – ./hosting-holium-com

hosting-holium-com-git-master-holium.vercel.app
realm-onboarding.vercel.app
hosting-holium-com-holium.vercel.app
hosting.holium.com

Please sign in to comment.