mirror of
https://github.com/appwrite/console.git
synced 2026-11-18 20:47:21 +00:00
address comments.
This commit is contained in:
1 parent
a0eeee5ee8
commit
f5501f30a5
8 files changed
+9
-9
No files matched your search
@@ -3,8 +3,8 @@ import { parse } from 'tldts';
|
||||
/**
|
||||
* Returns the apex/root domain from a full domain string.
|
||||
*/
|
||||
export function getApexDomain(domain: string): string {
|
||||
return parse(domain).domain || '';
|
||||
export function getApexDomain(domain: string): string|null {
|
||||
return parse(domain).domain;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
+1
-1
@@ -51,7 +51,7 @@
|
||||
const apexDomain = getApexDomain(domainName);
|
||||
let domain = data.domains?.domains.find((d) => d.domain === apexDomain);
|
||||
|
||||
if (!domain && isCloud) {
|
||||
if (apexDomain && !domain && isCloud) {
|
||||
try {
|
||||
domain = await sdk.forConsole.domains.create($project.teamId, apexDomain);
|
||||
} catch (error) {
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
let { data } = $props();
|
||||
|
||||
const ruleId = page.url.searchParams.get('rule');
|
||||
let isSubDomain = $derived.by(() => isASubdomain(page.params.domain));
|
||||
const isSubDomain = $derived.by(() => isASubdomain(page.params.domain));
|
||||
|
||||
let selectedTab = $state<'cname' | 'nameserver' | 'a' | 'aaaa'>('nameserver');
|
||||
$effect(() => {
|
||||
|
||||
+1
-1
@@ -31,7 +31,7 @@
|
||||
const apexDomain = getApexDomain(domainName);
|
||||
let domain = data.domains?.domains.find((d) => d.domain === apexDomain);
|
||||
|
||||
if (!domain && isCloud) {
|
||||
if (apexDomain && !domain && isCloud) {
|
||||
try {
|
||||
domain = await sdk.forConsole.domains.create($project.teamId, apexDomain);
|
||||
} catch (error) {
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
let { data } = $props();
|
||||
|
||||
const ruleId = page.url.searchParams.get('rule');
|
||||
let isSubDomain = $derived.by(() => isASubdomain(page.params.domain));
|
||||
const isSubDomain = $derived.by(() => isASubdomain(page.params.domain));
|
||||
|
||||
let selectedTab = $state<'cname' | 'nameserver' | 'a' | 'aaaa'>('nameserver');
|
||||
$effect(() => {
|
||||
|
||||
+1
-1
@@ -56,7 +56,7 @@
|
||||
const apexDomain = getApexDomain(domainName);
|
||||
let domain = data.domains?.domains.find((d) => d.domain === apexDomain);
|
||||
|
||||
if (!domain && isCloud) {
|
||||
if (apexDomain && !domain && isCloud) {
|
||||
try {
|
||||
domain = await sdk.forConsole.domains.create($project.teamId, apexDomain);
|
||||
} catch (error) {
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
let { data } = $props();
|
||||
|
||||
const ruleId = page.url.searchParams.get('rule');
|
||||
let isSubDomain = $derived.by(() => isASubdomain(page.params.domain));
|
||||
const isSubDomain = $derived.by(() => isASubdomain(page.params.domain));
|
||||
|
||||
let selectedTab = $state<'cname' | 'nameserver' | 'a' | 'aaaa'>('nameserver');
|
||||
|
||||
|
||||
+1
-1
@@ -23,7 +23,7 @@
|
||||
selectedDomain: Models.ProxyRule;
|
||||
} = $props();
|
||||
|
||||
let isSubDomain = $derived.by(() => isASubdomain(selectedDomain?.domain));
|
||||
const isSubDomain = $derived.by(() => isASubdomain(selectedDomain?.domain));
|
||||
|
||||
let selectedTab = $state<'cname' | 'nameserver' | 'a' | 'aaaa'>('nameserver');
|
||||
$effect(() => {
|
||||
|
||||
Reference in new issue
Block a user