Add __STATES_STATS__ for debugging

pull/286/head
Lim Chee Aun 2023-10-28 11:07:35 +08:00
rodzic 087e282677
commit a1021e1aee
1 zmienionych plików z 14 dodań i 0 usunięć

Wyświetl plik

@ -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