Commit 6cbdaa0f authored by JC Brand's avatar JC Brand

Bugfix. Bookmarks list didn't remember toggle state

We need to wait for the state to be fetched from storage before
rendering the list.
parent 298300e8
......@@ -48940,9 +48940,16 @@ _converse_headless_converse_core__WEBPACK_IMPORTED_MODULE_0__["default"].plugins
'id': id
});
this.list_model.browserStorage = new Backbone.BrowserStorage[storage](id);
this.list_model.fetch();
this.render();
this.sortAndPositionAllItems();
const render = () => {
this.render();
this.sortAndPositionAllItems();
};
this.list_model.fetch({
'success': render,
'error': render
});
},
render() {
......@@ -440,9 +440,12 @@ converse.plugins.add('converse-bookmarks', {
id = `converse.room-bookmarks${_converse.bare_jid}-list-model`;
this.list_model = new _converse.BookmarksList({'id': id});
this.list_model.browserStorage = new Backbone.BrowserStorage[storage](id);
this.list_model.fetch();
this.render();
this.sortAndPositionAllItems();
const render = () => {
this.render();
this.sortAndPositionAllItems();
}
this.list_model.fetch({'success': render, 'error': render});
},
render () {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment