[feat] better store saving logic + more launch options

This commit is contained in:
Purp1e
2025-03-13 22:04:27 +08:00
parent 7195bad731
commit 0bd15a80cd
4 changed files with 22 additions and 12 deletions

View File

@@ -37,6 +37,17 @@ export const setPowerPlan = (plan: number) => {
toolStore.state.powerPlan = plan
}
export const addLaunchOption = (option: string) => {
// 限制最高10个
if (toolStore.state.launchOptions.length >= 10) {
return
}
toolStore.state.launchOptions = [
...toolStore.state.launchOptions,
option,
]
}
export const resetToolStore = () => {
toolStore.state.launchOptions = defaultValue.launchOptions
toolStore.state.launchIndex = defaultValue.launchIndex