Browse Source

Don't show saved messages in top peers

Don't show '0 seconds' in call duration
master
Eduard Kuzmenko 3 years ago
parent
commit
2adb7e3528
  1. 5
      src/components/appSearchSuper..ts
  2. 9
      src/helpers/formatDuration.ts

5
src/components/appSearchSuper..ts

@ -826,6 +826,11 @@ export default class AppSearchSuper { @@ -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) => {

9
src/helpers/formatDuration.ts

@ -34,5 +34,12 @@ export default function formatDuration(duration: number, showLast = 2) { @@ -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;
}

Loading…
Cancel
Save