chore: catch error in getMore
This commit is contained in:
parent
16265b566e
commit
5926eb53ba
1 changed files with 8 additions and 6 deletions
|
@ -41,12 +41,14 @@
|
||||||
const server = new window.umap.ServerRequest(ui)
|
const server = new window.umap.ServerRequest(ui)
|
||||||
const getMore = async function (e) {
|
const getMore = async function (e) {
|
||||||
L.DomEvent.stop(e)
|
L.DomEvent.stop(e)
|
||||||
const [{html}, response] = await server.get(this.href)
|
const [{html}, response, error] = await server.get(this.href)
|
||||||
const container = this.parentNode
|
if (!error) {
|
||||||
container.innerHTML = html
|
const container = this.parentNode
|
||||||
const more = document.querySelector('.more_button')
|
container.innerHTML = html
|
||||||
if (more) {
|
const more = document.querySelector('.more_button')
|
||||||
L.DomEvent.on(more, 'click', getMore, more)
|
if (more) {
|
||||||
|
L.DomEvent.on(more, 'click', getMore, more)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const more = document.querySelector('.more_button')
|
const more = document.querySelector('.more_button')
|
||||||
|
|
Loading…
Reference in a new issue