diff --git a/content/home.en.md b/content/home.en.md
index 02253c7..bd9d3fc 100644
--- a/content/home.en.md
+++ b/content/home.en.md
@@ -119,7 +119,8 @@ or the entire fediverse.
Liste des instances
-This is like picking an e-mail hosting provider: the domain will also be part of your username!
+We are sorry but we failed to list available instances. Please try again later.
+This is like picking an e-mail hosting provider: the domain will be part of your username!
{{% /grid %}}
diff --git a/content/home.fr.md b/content/home.fr.md
index 3d2b81d..37d1f63 100644
--- a/content/home.fr.md
+++ b/content/home.fr.md
@@ -119,7 +119,8 @@ Liste des instances
-This is like picking an e-mail hosting provider: the domain will also be part of your username!
+Nous sommes désolé mais nous n'arrivons pas à récupérer la liste des instances. Merci de réessayer plus tard.
+C'est comme choisir un fournisseur d'email : le nom de domaine fera partie de votre identifiant !
{{% /grid %}}
{{% /grid %}}
diff --git a/themes/hugo-bootstrap-premium/static/js/instances.js b/themes/hugo-bootstrap-premium/static/js/instances.js
index 3dab9d7..761d67c 100644
--- a/themes/hugo-bootstrap-premium/static/js/instances.js
+++ b/themes/hugo-bootstrap-premium/static/js/instances.js
@@ -6,19 +6,23 @@ $(function () {
signup: true,
healthy: true
}
+ const instancesListElement = $('#instances-list')
- $.get(instancesApi, data, function (res) {
- const instances = res.data
+ $.get(instancesApi, data)
+ .done(function (res) {
+ const instances = res.data
- const lis = []
- instances.forEach(function (instance) {
- const el = createInstanceElement(instance.host, instance.name, instance.shortDescription)
- lis.push(el)
+ const lis = []
+ instances.forEach(function (instance) {
+ const el = createInstanceElement(instance.host, instance.name, instance.shortDescription)
+ lis.push(el)
+ })
+
+ instancesListElement.append(lis)
+ })
+ .fail(function (err) {
+ $('#instances-list-error').css('display', 'block')
})
-
- $('#instances-list').append(lis)
-
- })
function createInstanceElement (host, name, description) {
const a = $('', {