2 Commits

Author SHA1 Message Date
db95b12985 v1.1.0 2022-11-30 10:42:48 -03:00
8648f5a62e v1.0.0 2022-11-29 11:12:35 -03:00
2 changed files with 5 additions and 20 deletions

View File

@ -221,13 +221,7 @@
}, },
messages: () => { messages: () => {
const uri = '/mailbox/{{$mailbox_id}}/messages/valid' const uri = '/mailbox/{{$mailbox_id}}/messages/valid'
return Send.get(uri).then((response, status, jqXHR) => { return Send.get(uri).then(response => {
if (parseInt(jqXHR.status/100) !== 2 || jqXHR.status === 204) {
$(this.id.results).html('').append(
this.draw().empty()
)
return
}
if (this.total === null) { if (this.total === null) {
$(this.id.count).html(' (' + response.total + ')') $(this.id.count).html(' (' + response.total + ')')
this.total = response.total this.total = response.total
@ -390,7 +384,6 @@
) )
}, },
empty: () => { empty: () => {
$(this.id.count).html(' (0)')
return $('<div></div>').addClass('ui message').html('No messages found.') return $('<div></div>').addClass('ui message').html('No messages found.')
} }
} }
@ -455,4 +448,4 @@
messages.setup() messages.setup()
}) })
</script> </script>
@endpush @endpush

View File

@ -14,8 +14,7 @@
const uri = '/mailboxes/registered' const uri = '/mailboxes/registered'
this.draw().loading() this.draw().loading()
return Send.get(uri).then((response, status, jqXHR) => { return Send.get(uri).then((response, status, jqXHR) => {
if (parseInt(jqXHR.status / 100) !== 2 || jqXHR.status === 204) { if (parseInt(jqXHR.status / 100) !== 2) {
this.draw().empty()
return return
} }
if (jqXHR.status === 200) { if (jqXHR.status === 200) {
@ -45,7 +44,7 @@
const parent = $(this.div_id) const parent = $(this.div_id)
parent.html('') parent.html('')
if (this.mailboxes.length === 0) { if (this.mailboxes.length === 0) {
this.draw().empty() parent.html('No mailboxes registered.')
return return
} }
const list = $('<div></div>').addClass('ui list') const list = $('<div></div>').addClass('ui list')
@ -55,13 +54,6 @@
) )
}) })
parent.append(list) parent.append(list)
},
empty: () => {
const parent = $(this.div_id)
parent.html('')
parent.append(
$('<div></div>').addClass('ui message').html('No mailboxes registered.')
)
} }
} }
} }
@ -71,4 +63,4 @@
mailboxes.get() mailboxes.get()
}) })
</script> </script>
@endpush @endpush