Properly set checkbox state in bookmark form

This commit is contained in:
JC Brand 2023-02-22 10:19:47 +01:00
parent 16b442ac19
commit e1e93c2ec9
3 changed files with 3 additions and 2 deletions

View File

@ -4,6 +4,7 @@
- Add the ability to set roles and affiliations via the MUC occupant modal
- Fix `isOnlyEmojis is not a function` when using only `@converse/headless`
- Fix `autojoin` checkbox state in MUC bookmark form
## 10.1.2 (2023-02-17)

View File

@ -25,7 +25,7 @@ class MUCBookmarkForm extends CustomElement {
onBookmarkFormSubmitted (ev) {
ev.preventDefault();
_converse.bookmarks.createBookmark({
'jid': this.model.get('jid'),
'jid': this.jid,
'autojoin': ev.target.querySelector('input[name="autojoin"]')?.checked || false,
'name': ev.target.querySelector('input[name=name]')?.value,
'nick': ev.target.querySelector('input[name=nick]')?.value

View File

@ -25,7 +25,7 @@ export default (el) => {
<input class="form-control" type="text" name="nick" value="${nick || ''}" id="converse_muc_bookmark_nick"/>
</fieldset>
<fieldset class="form-group form-check">
<input class="form-check-input" id="converse_muc_bookmark_autojoin" type="checkbox" name="autojoin"/>
<input class="form-check-input" id="converse_muc_bookmark_autojoin" type="checkbox" ?checked=${el.bookmark?.get('autojoin')} name="autojoin"/>
<label class="form-check-label" for="converse_muc_bookmark_autojoin">${i18n_autojoin}</label>
</fieldset>
<fieldset class="form-group">