mirror of
https://github.com/cheeaun/phanpy.git
synced 2024-11-28 04:12:41 +03: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
|
||||
if (statuses.length) {
|
||||
stats.daysSinceLastPost = Math.ceil(
|
||||
(Date.now() - new Date(statuses[statuses.length - 1].createdAt)) / 86400000,
|
||||
(Date.now() - new Date(statuses[statuses.length - 1].createdAt)) /
|
||||
86400000,
|
||||
);
|
||||
}
|
||||
|
||||
console.log('posting stats', stats);
|
||||
return stats;
|
||||
|
|
Loading…
Reference in a new issue