load bigger page on show more

This commit is contained in:
Martti Malmi 2022-06-24 12:01:54 +03:00
parent 2fcd224863
commit 51c187da3c
2 changed files with 4 additions and 4 deletions

View File

@ -176,7 +176,7 @@ function init() {
State.local.get('settings').get('maxConnectedPeers').on(n => {
if (n !== undefined) maxConnectedPeers = n;
});
setInterval(checkGunPeerCount, 2000);
setInterval(checkGunPeerCount, 1000);
}
export default {

View File

@ -6,12 +6,12 @@ import State from '../State';
import _ from 'lodash';
import {translate as t} from '../Translation';
const PAGE_SIZE = 20;
const INITIAL_PAGE_SIZE = 20;
class MessageFeed extends Component {
constructor() {
super();
this.state = {sortedMessages:[], displayCount: PAGE_SIZE};
this.state = {sortedMessages:[], displayCount: INITIAL_PAGE_SIZE};
this.mappedMessages = new Map();
}
@ -73,7 +73,7 @@ class MessageFeed extends Component {
`)}
${displayCount < this.state.sortedMessages.length ? html`
<p>
<button onClick=${() => this.setState({displayCount: displayCount + PAGE_SIZE})}>
<button onClick=${() => this.setState({displayCount: displayCount + INITIAL_PAGE_SIZE * 3})}>
${t('show_more')}
</button>
</p>