No registered mailboxes
This commit is contained in:
@ -14,7 +14,8 @@
|
||||
const uri = '/mailboxes/registered'
|
||||
this.draw().loading()
|
||||
return Send.get(uri).then((response, status, jqXHR) => {
|
||||
if (parseInt(jqXHR.status / 100) !== 2) {
|
||||
if (parseInt(jqXHR.status / 100) !== 2 || jqXHR.status === 204) {
|
||||
this.draw().empty()
|
||||
return
|
||||
}
|
||||
if (jqXHR.status === 200) {
|
||||
@ -44,7 +45,7 @@
|
||||
const parent = $(this.div_id)
|
||||
parent.html('')
|
||||
if (this.mailboxes.length === 0) {
|
||||
parent.html('No mailboxes registered.')
|
||||
this.draw().empty()
|
||||
return
|
||||
}
|
||||
const list = $('<div></div>').addClass('ui list')
|
||||
@ -54,6 +55,13 @@
|
||||
)
|
||||
})
|
||||
parent.append(list)
|
||||
},
|
||||
empty: () => {
|
||||
const parent = $(this.div_id)
|
||||
parent.html('')
|
||||
parent.append(
|
||||
$('<div></div>').addClass('ui message').html('No mailboxes registered.')
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user