mirror of
https://github.com/huhu/rust-search-extension
synced 2024-11-14 15:47:12 +00:00
Rename target methods
This commit is contained in:
parent
3cb8eb5775
commit
64850e4d1b
3 changed files with 5 additions and 5 deletions
|
@ -84,11 +84,11 @@ class IndexManager {
|
|||
storage.setItem('index-rustc', index);
|
||||
}
|
||||
|
||||
static async getTargetsIndex() {
|
||||
static async getTargetIndex() {
|
||||
return await storage.getItem('index-target') || targetsIndex;
|
||||
}
|
||||
|
||||
static setTargetsIndex(index) {
|
||||
static setTargetIndex(index) {
|
||||
storage.setItem('index-target', index);
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ function getPlatformOs() {
|
|||
let labelCommand = new LabelCommand(await IndexManager.getLabelIndex());
|
||||
let rfcCommand = new RfcCommand(await IndexManager.getRfcIndex());
|
||||
let rustcCommand = new RustcCommand(await IndexManager.getRustcIndex());
|
||||
let targetCommand = new TargetCommand(await IndexManager.getTargetsIndex());
|
||||
let targetCommand = new TargetCommand(await IndexManager.getTargetIndex());
|
||||
const cargoCommand = new SimpleCommand('cargo', 'Search useful third-party cargo subcommands.', commandIndex['cargo']);
|
||||
const bookCommand = new SimpleCommand('book', 'Search Rust books.', commandIndex['book']);
|
||||
const bookZhCommand = new SimpleCommand('book/zh', 'Search Chinese Rust books.', commandIndex['book/zh']);
|
||||
|
|
|
@ -6,7 +6,7 @@ window.addEventListener("message", async function (event) {
|
|||
console.log('target:', message.target);
|
||||
switch (message.target) {
|
||||
case 'book': {
|
||||
await IndexManager.setBookIndex(message.index);
|
||||
IndexManager.setBookIndex(message.index);
|
||||
break;
|
||||
}
|
||||
case 'caniuse': {
|
||||
|
@ -39,7 +39,7 @@ window.addEventListener("message", async function (event) {
|
|||
break;
|
||||
}
|
||||
case 'target': {
|
||||
IndexManager.setTargetsIndex(message.index);
|
||||
IndexManager.setTargetIndex(message.index);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue