ui: Handle empty importable domains list

This commit is contained in:
nemunaire 2023-11-27 14:05:58 +01:00
parent 9206115301
commit d7c3c46fc5
1 changed files with 8 additions and 1 deletions

View File

@ -14,6 +14,7 @@
import { addDomain } from '$lib/api/domains';
import { listImportableDomains } from '$lib/api/provider';
import ZoneList from '$lib/components/ZoneList.svelte';
import { domainCompare } from '$lib/dns';
import type { DomainInList } from '$lib/model/domain';
import type { Provider } from '$lib/model/provider';
import { providersSpecs } from '$lib/stores/providers';
@ -32,7 +33,13 @@
discoveryError = null;
noDomainsList = false;
listImportableDomains(provider).then(
(l) => importableDomainsList = l,
(l) => {
if (l === null) {
importableDomainsList = [];
} else {
importableDomainsList = l;
}
},
(err) => {
importableDomainsList = [];
if (err.name == "ProviderNoDomainListingSupport") {