|
@@ -2,14 +2,14 @@ import bookmark_item from './item.js';
|
|
|
import { __ } from 'i18n';
|
|
|
import { _converse } from '@converse/headless/core.js';
|
|
|
import { html } from "lit";
|
|
|
+import { until } from 'lit/directives/until.js';
|
|
|
|
|
|
-export default (el) => {
|
|
|
- const should_show = !!_converse.bookmarks.getUnopenedBookmarks().length;
|
|
|
+const list = (el, bookmarks) => {
|
|
|
const desc_bookmarks = __('Click to toggle the bookmarks list');
|
|
|
const label_bookmarks = __('Bookmarks');
|
|
|
const toggle_state = el.model.get('toggle-state');
|
|
|
return html`
|
|
|
- <div class="list-container list-container--bookmarks ${ should_show ? 'fade-in' : 'hidden' }">
|
|
|
+ <div class="list-container list-container--bookmarks ${ bookmarks.length ? 'fade-in' : 'hidden' }">
|
|
|
<a class="list-toggle bookmarks-toggle controlbox-padded"
|
|
|
title="${desc_bookmarks}"
|
|
|
@click=${() => el.toggleBookmarksList()}>
|
|
@@ -22,3 +22,8 @@ export default (el) => {
|
|
|
</div>
|
|
|
`;
|
|
|
}
|
|
|
+
|
|
|
+export default (el) => {
|
|
|
+ const bookmarks = _converse.bookmarks.getUnopenedBookmarks();
|
|
|
+ return until(bookmarks.then((bookmarks) => list(el, bookmarks)), '');
|
|
|
+}
|