mirror of
https://github.com/cheeaun/phanpy.git
synced 2025-02-02 14:16:39 +01:00
Fix error with zero posts
This commit is contained in:
parent
5481aa12be
commit
cd403fe605
1 changed files with 6 additions and 3 deletions
|
@ -102,9 +102,12 @@ async function fetchPostingStats(accountID, masto) {
|
||||||
});
|
});
|
||||||
|
|
||||||
// Count days since last post
|
// Count days since last post
|
||||||
stats.daysSinceLastPost = Math.ceil(
|
if (statuses.length) {
|
||||||
(Date.now() - new Date(statuses[statuses.length - 1].createdAt)) / 86400000,
|
stats.daysSinceLastPost = Math.ceil(
|
||||||
);
|
(Date.now() - new Date(statuses[statuses.length - 1].createdAt)) /
|
||||||
|
86400000,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
console.log('posting stats', stats);
|
console.log('posting stats', stats);
|
||||||
return stats;
|
return stats;
|
||||||
|
|
Loading…
Reference in a new issue