Skip to content

Commit 3cb2de3

Browse files
authored
fix(web): fix rendering issues when custom domain not exist (#1342)
1 parent c02820b commit 3cb2de3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

web/src/pages/app/functions/mods/EditorPanel/EditDomain.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export default function EditDomain(props: { children: any }) {
3131
const { currentApp, showSuccess, setCurrentApp } = useGlobalStore();
3232

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

3737
const bindDomainMutation = useBindDomainMutation();
@@ -43,7 +43,7 @@ export default function EditDomain(props: { children: any }) {
4343
{React.cloneElement(children, {
4444
onClick: (event?: any) => {
4545
event?.preventDefault();
46-
reset({ domain: currentApp?.domain.customDomain || "" });
46+
reset({ domain: currentApp?.domain?.customDomain || "" });
4747
onOpen();
4848
},
4949
})}
@@ -58,10 +58,10 @@ export default function EditDomain(props: { children: any }) {
5858
<FormControl>
5959
<FormLabel>CNAME</FormLabel>
6060
<InputGroup>
61-
<Input variant="filled" value={currentApp?.domain.domain} readOnly />
61+
<Input variant="filled" value={currentApp?.domain?.domain} readOnly />
6262
<InputRightAddon
6363
children={
64-
<CopyText text={currentApp?.domain.domain} className="cursor-pointer" />
64+
<CopyText text={currentApp?.domain?.domain} className="cursor-pointer" />
6565
}
6666
/>
6767
</InputGroup>

0 commit comments

Comments
 (0)