Skip to content

Commit

Permalink
Fix crate searcher version cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Folyd committed Apr 22, 2023
1 parent 903dda4 commit 994b589
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion extension/search/docs/crate-doc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ class SingleCrateDocSearch extends DocSearch {

constructor(name, version, searchIndex) {
super(name, searchIndex, () => {
return `https://docs.rs/${name}/${version}/`;
return `https://docs.rs/${name}/${this.version}/`;
});
this.version = version;
}
}

Expand All @@ -31,6 +32,7 @@ class CrateDocSearch {
let searcher = null;
if (this.cachedCrateSearcher?.name === crateName) {
searcher = this.cachedCrateSearcher;
searcher.version = await settings.keepCratesUpToDate ? "latest" : searcher.version;
} else {
let crate = await CrateDocManager.getCrateByName(crateName);
if (crate) {
Expand Down

0 comments on commit 994b589

Please sign in to comment.