Skip to content

Commit bc2b8e5

Browse files
committed
update: redirect after domain verified.
1 parent 7f80d2d commit bc2b8e5

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

src/routes/(console)/organization-[organization]/domains/recordsCard.svelte

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,18 @@
1616
Input,
1717
InteractiveText
1818
} from '@appwrite.io/pink-svelte';
19+
import { base } from '$app/paths';
20+
import { page } from '$app/state';
21+
import { goto } from '$app/navigation';
1922
2023
export let domain: Domain;
2124
2225
let verified = undefined;
2326
27+
const routeBase = `${base}/organization-${page.params.organization}/domains/domain-${domain.$id}`;
28+
2429
// TODO: split _APP_DOMAINS_NAMESERVERS?
25-
let nameservers = $consoleVariables?._APP_DOMAINS_NAMESERVERS.split(',') ?? [
30+
const nameservers = $consoleVariables?._APP_DOMAINS_NAMESERVERS.split(',') ?? [
2631
'ns1.appwrite.io',
2732
'ns2.appwrite.io'
2833
];
@@ -31,6 +36,19 @@
3136
try {
3237
domain = await sdk.forConsole.domains.updateNameservers(domain.$id);
3338
verified = domain.nameservers === 'Appwrite';
39+
if (verified) {
40+
addNotification({
41+
type: 'success',
42+
message: 'Domain verified'
43+
});
44+
45+
await goto(routeBase);
46+
} else {
47+
addNotification({
48+
type: 'error',
49+
message: 'Domain not verified'
50+
});
51+
}
3452
} catch (error) {
3553
addNotification({
3654
type: 'error',

src/routes/(console)/organization-[organization]/domains/retryDomainModal.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
1414
export let show = false;
1515
export let selectedDomain: Domain;
16-
let nameservers = $consoleVariables?._APP_DOMAINS_NAMESERVERS.split(',') ?? [
16+
const nameservers = $consoleVariables?._APP_DOMAINS_NAMESERVERS.split(',') ?? [
1717
'ns1.appwrite.io',
1818
'ns2.appwrite.io'
1919
];

0 commit comments

Comments
 (0)