From a1021e1aeeeee3b72926146358b3c82898923629 Mon Sep 17 00:00:00 2001 From: Lim Chee Aun Date: Sat, 28 Oct 2023 11:07:35 +0800 Subject: [PATCH] Add __STATES_STATS__ for debugging --- src/app.jsx | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/app.jsx b/src/app.jsx index a673a34e..c7393a0b 100644 --- a/src/app.jsx +++ b/src/app.jsx @@ -55,6 +55,20 @@ import { getCurrentAccount } from './utils/store-utils'; import './utils/toast-alert'; window.__STATES__ = states; +window.__STATES_STATS__ = () => { + const keys = [ + 'statuses', + 'accounts', + 'spoilers', + 'unfurledLinks', + 'statusQuotes', + ]; + const counts = {}; + keys.forEach((key) => { + counts[key] = Object.keys(states[key]).length; + }); + console.warn('STATE stats', counts); +}; // Preload icons // There's probably a better way to do this