Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
import { sdk } from '$lib/stores/sdk';
import { addNotification } from '$lib/stores/notifications';
import RetryDomainModal from '$routes/(console)/organization-[organization]/domains/retryDomainModal.svelte';
import { invalidate } from '$app/navigation';
import { Dependencies } from '$lib/constants';

export let data;

Expand All @@ -35,6 +37,10 @@
let showImportModal = false;
let selectedPreset = '';

async function reloadDomainData() {
await Promise.all([invalidate(Dependencies.DOMAIN), invalidate(Dependencies.DOMAINS)]);
}
Comment on lines +41 to +42
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this already done on the RetryDomainModal? What difference does this make moving up a layer via callback?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The modal does refresh data, but the parent page isn’t aware of it. Sending an event ensures the parent updates its UI instantly after verification

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Invalidating a dependency invalidates the data fetch from page.ts and then to page.svelte.
Can you instead verify and see if the domain verification variable is updated correctly?


async function downloadRecords() {
try {
const zone = await sdk.forConsole.domains.getZone(data.domain.$id);
Expand Down Expand Up @@ -149,5 +155,8 @@
{/if}

{#if showRetry}
<RetryDomainModal bind:show={showRetry} selectedDomain={data.domain} />
<RetryDomainModal
bind:show={showRetry}
selectedDomain={data.domain}
on:verified={reloadDomainData} />
{/if}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import { Link } from '$lib/elements';
import { consoleVariables } from '$routes/(console)/store';
import type { Models } from '@appwrite.io/console';
import { createEventDispatcher } from 'svelte';

let {
show = $bindable(),
Expand All @@ -19,6 +20,8 @@
selectedDomain: Models.Domain;
} = $props();

const dispatch = createEventDispatcher();

const nameservers = $consoleVariables?._APP_DOMAINS_NAMESERVERS.split(',') ?? [
'ns1.appwrite.io',
'ns2.appwrite.io'
Expand All @@ -35,6 +38,7 @@
type: 'success',
message: `${selectedDomain.domain} has been verified`
});
dispatch('verified');
} else {
error =
'Domain verification failed. Please check your domain settings or try again later';
Expand Down