chore: catch error in getMore

This commit is contained in:
Yohan Boniface 2024-01-26 09:39:18 +01:00
parent 16265b566e
commit 5926eb53ba

View file

@ -41,7 +41,8 @@
const server = new window.umap.ServerRequest(ui)
const getMore = async function (e) {
L.DomEvent.stop(e)
const [{html}, response] = await server.get(this.href)
const [{html}, response, error] = await server.get(this.href)
if (!error) {
const container = this.parentNode
container.innerHTML = html
const more = document.querySelector('.more_button')
@ -49,6 +50,7 @@
L.DomEvent.on(more, 'click', getMore, more)
}
}
}
const more = document.querySelector('.more_button')
if (more) {
L.DomEvent.on(more, 'click', getMore, more)