File tree 1 file changed +10
-9
lines changed
1 file changed +10
-9
lines changed Original file line number Diff line number Diff line change 24
24
];
25
25
26
26
onMount (async () => {
27
- if ((await storage .getItem (" first-visit" )) !== " false" ) {
27
+ let firstVisit = await storage .getItem (" first-visit" );
28
+ if (firstVisit === null ) {
29
+ let response = await fetch (" https://crates.io/api/v1/crates/tokio" );
30
+ let data = await response .json ();
31
+ response = await fetch (
32
+ ` https://query.rs/index/${ data .crate .name } /${ data .crate .newest_version } `
33
+ );
34
+ data = await response .json ();
35
+ await CrateDocManager .addCrate (data);
36
+
28
37
// Create first query record
29
38
let statistics = await Statistics .load ();
30
39
await statistics .record (
36
45
},
37
46
true
38
47
);
39
-
40
- let response = await fetch (" https://crates.io/api/v1/crates/tokio" );
41
- let data = await response .json ();
42
- response = await fetch (
43
- ` https://query.rs/index/${ data .crate .name } /${ data .crate .newest_version } `
44
- );
45
- data = await response .json ();
46
- await CrateDocManager .addCrate (data);
47
48
await storage .setItem (" first-visit" , " false" );
48
49
}
49
50
});
You can’t perform that action at this time.
0 commit comments