mirror of
https://github.com/huhu/rust-search-extension
synced 2024-11-14 15:47:12 +00:00
Change the way to get creates data (#223)
This commit is contained in:
parent
9d1602d1e0
commit
c5cec9f41c
1 changed files with 7 additions and 1 deletions
|
@ -41,7 +41,13 @@ async function refresh(orderBy = "time") {
|
|||
}
|
||||
|
||||
let compat = new Compat();
|
||||
let cratesData = (await Statistics.load()).cratesData;
|
||||
const { timeline } = await Statistics.load();
|
||||
const cratesData = timeline.reduce((pre, [time, type, crate]) => {
|
||||
if(crate) {
|
||||
pre[crate] = (pre[crate] || 0) + 1;
|
||||
}
|
||||
return pre;
|
||||
}, Object.create(null));
|
||||
let crates = Object.entries(await CrateDocManager.getCrates()).map(([name, crate]) => {
|
||||
return {
|
||||
name,
|
||||
|
|
Loading…
Reference in a new issue