xmpp.chapril.org-conversejs/src/plugins/mam-views/placeholder.js
JC Brand 15c10376b0 Rename all templates to camelCase
To conform with naming conventions regarding functions, which the
templates are.
2023-02-15 14:29:07 +01:00

34 lines
911 B
JavaScript

import { CustomElement } from 'shared/components/element.js';
import tplPlaceholder from './templates/placeholder.js';
import { api } from "@converse/headless/core";
import { fetchArchivedMessages } from '@converse/headless/plugins/mam/utils.js';
import './styles/placeholder.scss';
class Placeholder extends CustomElement {
static get properties () {
return {
'model': { type: Object }
}
}
render () {
return tplPlaceholder(this);
}
async fetchMissingMessages (ev) {
ev?.preventDefault?.();
this.model.set('fetching', true);
const options = {
'before': this.model.get('before'),
'start': this.model.get('start')
}
await fetchArchivedMessages(this.model.collection.chatbox, options);
this.model.destroy();
}
}
api.elements.define('converse-mam-placeholder', Placeholder);