File tree Expand file tree Collapse file tree
apps/builder/app/builder/features/topbar Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -71,18 +71,6 @@ export const AddDomain = ({
7171 return ;
7272 }
7373
74- if ( cname === "www" ) {
75- const result = await nativeClient . domain . create . mutate ( {
76- domain : domain . slice ( "www." . length ) ,
77- projectId,
78- } ) ;
79- if ( result . success === false ) {
80- toast . error ( result . error ) ;
81- setError ( result . error ) ;
82- return ;
83- }
84- }
85-
8674 onCreate ( domain ) ;
8775
8876 await refresh ( ) ;
Original file line number Diff line number Diff line change @@ -155,11 +155,21 @@ export const verify = async (
155155 domain,
156156 txtRecord : projectDomain . data . txtRecord ,
157157 } ) ;
158-
159158 if ( createDomainResult . success === false ) {
160159 return createDomainResult ;
161160 }
162161
162+ // create root certificate along with www
163+ if ( domain . startsWith ( "www." ) ) {
164+ const createDomainResult = await context . domain . domainTrpc . create . mutate ( {
165+ domain : domain . slice ( "www." . length ) ,
166+ txtRecord : projectDomain . data . txtRecord ,
167+ } ) ;
168+ if ( createDomainResult . success === false ) {
169+ return createDomainResult ;
170+ }
171+ }
172+
163173 const domainUpdateResult = await context . postgrest . client
164174 . from ( "Domain" )
165175 . update ( {
You can’t perform that action at this time.
0 commit comments