Don't show saved messages in top peers

Don't show '0 seconds' in call duration
This commit is contained in:
Eduard Kuzmenko 2021-06-20 19:21:28 +03:00
parent 2d624e2a21
commit 252182a1f9
2 changed files with 13 additions and 1 deletions

View File

@ -826,6 +826,11 @@ export default class AppSearchSuper {
appUsersManager.getTopPeers().then(peers => {
if(!middleware()) return;
const idx = peers.indexOf(rootScope.myId);
if(idx !== -1) {
peers = peers.slice();
peers.splice(idx, 1);
}
//console.log('got top categories:', categories);
if(peers.length) {
peers.forEach((peerId) => {

View File

@ -34,5 +34,12 @@ export default function formatDuration(duration: number, showLast = 2) {
});
});
return d.slice(-showLast).reverse();
const out = d.slice(-showLast).reverse();
for(let i = out.length - 1; i >= 0; --i) {
if(out[i].duration === 0) {
out.splice(i, 1);
}
}
return out;
}