From 2f73506e25c2cf1d3197c9f48a874d3495610c54 Mon Sep 17 00:00:00 2001 From: BlipRanger <1860540+BlipRanger@users.noreply.github.com> Date: Tue, 18 Jul 2023 21:48:12 -0400 Subject: [PATCH] Prettier again. --- public/scripts/stats.js | 45 +++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 22 deletions(-) diff --git a/public/scripts/stats.js b/public/scripts/stats.js index a77e2f3b4..f049471df 100644 --- a/public/scripts/stats.js +++ b/public/scripts/stats.js @@ -43,7 +43,7 @@ function calculateTotalStats() { non_user_word_count: 0, total_swipe_count: 0, date_last_chat: 0, - date_first_chat: new Date('9999-12-31T23:59:59.999Z').getTime(), + date_first_chat: new Date("9999-12-31T23:59:59.999Z").getTime(), }; for (let stats of Object.values(charStats)) { @@ -56,28 +56,30 @@ function calculateTotalStats() { totalStats.non_user_word_count += verifyStatValue( stats.non_user_word_count ); - totalStats.total_swipe_count += verifyStatValue(stats.total_swipe_count); + totalStats.total_swipe_count += verifyStatValue( + stats.total_swipe_count + ); - if(verifyStatValue(stats.date_last_chat) != 0){ + if (verifyStatValue(stats.date_last_chat) != 0) { totalStats.date_last_chat = Math.max( totalStats.date_last_chat, stats.date_last_chat ); } - if (verifyStatValue(stats.date_first_chat) != 0){ + if (verifyStatValue(stats.date_first_chat) != 0) { totalStats.date_first_chat = Math.min( totalStats.date_first_chat, stats.date_first_chat ); } - } + } return totalStats; } /** * Generates an HTML report of stats. - * + * * This function creates an HTML report from the provided stats, including chat age, * chat time, number of user messages and character messages, word count, and swipe count. * The stat blocks are tailored depending on the stats type ("User" or "Character"). @@ -97,16 +99,19 @@ function createHtml(statsType, stats) { // Get time string let timeStirng = humanizeGenTime(stats.total_gen_time); let chatAge = "Never"; - if(stats.date_first_chat < Date.now()) { - chatAge = moment.duration(stats.date_last_chat - stats.date_first_chat).humanize(); + if (stats.date_first_chat < Date.now()) { + chatAge = moment + .duration(stats.date_last_chat - stats.date_first_chat) + .humanize(); } // Create popup HTML with stats let html = `