simplified jqeury code

This commit is contained in:
Rohan Sircar 2020-07-23 12:21:53 +05:30
parent 05ba6fbacc
commit 85a8f41da0

View File

@ -5,17 +5,9 @@ import log from "loglevel";
export async function stats(): Promise<void> { export async function stats(): Promise<void> {
const stats = await getStats(Credentials.authToken); const stats = await getStats(Credentials.authToken);
$("#totalMessages").each((i, el) => { $("#totalMessages").text(stats.totalMessages);
el.textContent = stats.totalMessages.toString(); $("#totalUsers").text(stats.totalUsers);
}); $("#totalOnlineUsers").text(stats.totalOnlineUsers);
$("#totalUsers").each((i, el) => { $("#numMessagesToday").text(stats.numMessagesToday);
el.textContent = stats.totalUsers.toString();
});
$("#totalOnlineUsers").each((i, el) => {
el.textContent = stats.totalOnlineUsers.toString();
});
$("#numMessagesToday").each((i, el) => {
el.textContent = stats.numMessagesToday.toString();
});
log.debug(stats); log.debug(stats);
} }