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