1
0
mirror of https://github.com/dwaxweiler/connector-mobilizon synced 2025-06-05 21:59:25 +02:00

fix showing group not found error in block

This commit is contained in:
Daniel Waxweiler
2025-05-23 21:21:04 +02:00
parent 3e2aac7657
commit 10f4f3eceb
4 changed files with 13 additions and 16 deletions

View File

@ -72,13 +72,7 @@ export function displayEvents({ events, document, container, maxEventsCount }) {
export function displayErrorMessage({ data, container }) {
hideLoadingIndicator(container)
if (
Object.prototype.hasOwnProperty.call(data, 'response') &&
Object.prototype.hasOwnProperty.call(data.response, 'errors') &&
data.response.errors.length > 0 &&
Object.prototype.hasOwnProperty.call(data.response.errors[0], 'code') &&
data.response.errors[0].code === 'group_not_found'
) {
if (Object.hasOwn(data, 'code') && data.code === 'group_not_found') {
const message = container.querySelector('.group-not-found')
message.style.display = 'block'
} else {