Skip to content

Commit

Permalink
fix(web): fix rendering issues when custom domain not exist (#1342)
Browse files Browse the repository at this point in the history
  • Loading branch information
newfish-cmyk committed Jun 30, 2023
1 parent c02820b commit 3cb2de3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions web/src/pages/app/functions/mods/EditorPanel/EditDomain.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export default function EditDomain(props: { children: any }) {
const { currentApp, showSuccess, setCurrentApp } = useGlobalStore();

const { register, handleSubmit, reset } = useForm<{ domain: string }>({
defaultValues: { domain: currentApp?.domain.customDomain || "" },
defaultValues: { domain: currentApp?.domain?.customDomain || "" },
});

const bindDomainMutation = useBindDomainMutation();
Expand All @@ -43,7 +43,7 @@ export default function EditDomain(props: { children: any }) {
{React.cloneElement(children, {
onClick: (event?: any) => {
event?.preventDefault();
reset({ domain: currentApp?.domain.customDomain || "" });
reset({ domain: currentApp?.domain?.customDomain || "" });
onOpen();
},
})}
Expand All @@ -58,10 +58,10 @@ export default function EditDomain(props: { children: any }) {
<FormControl>
<FormLabel>CNAME</FormLabel>
<InputGroup>
<Input variant="filled" value={currentApp?.domain.domain} readOnly />
<Input variant="filled" value={currentApp?.domain?.domain} readOnly />
<InputRightAddon
children={
<CopyText text={currentApp?.domain.domain} className="cursor-pointer" />
<CopyText text={currentApp?.domain?.domain} className="cursor-pointer" />
}
/>
</InputGroup>
Expand Down

0 comments on commit 3cb2de3

Please sign in to comment.