@ -72,6 +72,7 @@ export default class MUCPollFormView extends CustomElement {
|
||||
|
||||
const iq = $iq({
|
||||
type: 'set',
|
||||
to: this.model.get('jid'),
|
||||
id: u.getUniqueId()
|
||||
}).c('query', { xmlns: XMLNS_POLL })
|
||||
|
||||
@ -83,9 +84,19 @@ export default class MUCPollFormView extends CustomElement {
|
||||
await api.sendIQ(iq)
|
||||
|
||||
if (this.modal) {
|
||||
this.modal.hide()
|
||||
this.modal.onHide()
|
||||
}
|
||||
} catch (err) {
|
||||
if (u.isErrorStanza(err)) {
|
||||
// Checking if there is a text error that we can show to the user.
|
||||
if (sizzle('error bad-request', err).length) {
|
||||
const text = sizzle('error text', err)
|
||||
if (text.length) {
|
||||
this.alert_message = __('Error') + ': ' + text[0].textContent
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
console.error(err)
|
||||
this.alert_message = __('Error')
|
||||
}
|
||||
|
@ -20,13 +20,9 @@ export function tplPollForm (el) {
|
||||
|
||||
${el.form_fields}
|
||||
|
||||
${
|
||||
el.modal
|
||||
? html`` // no need for submit button, the modal will have one in the footer
|
||||
: html`<fieldset class="buttons form-group">
|
||||
<input type="submit" class="btn btn-primary" value="${i18nOk}" />
|
||||
</fieldset>`
|
||||
}
|
||||
<fieldset class="buttons form-group">
|
||||
<input type="submit" class="btn btn-primary" value="${i18nOk}" />
|
||||
</fieldset>
|
||||
</form>`
|
||||
: ''
|
||||
}`
|
||||
|
Reference in New Issue
Block a user