mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-16 13:27:08 +00:00
fix: config error
This commit is contained in:
parent
3c83e270df
commit
6b36552c08
1 changed files with 6 additions and 2 deletions
|
|
@ -264,8 +264,11 @@ class ChatGPTConfig {
|
|||
// 避免在代理对象保存时再次触发
|
||||
if (!target.__isSaving) {
|
||||
target.__isSaving = true
|
||||
this.saveToFile()
|
||||
target.__isSaving = false
|
||||
try {
|
||||
this.saveToFile()
|
||||
} finally {
|
||||
target.__isSaving = false
|
||||
}
|
||||
}
|
||||
}
|
||||
return true
|
||||
|
|
@ -287,6 +290,7 @@ class ChatGPTConfig {
|
|||
* Load config from file
|
||||
*/
|
||||
loadFromFile () {
|
||||
this.__isSaving = false;
|
||||
try {
|
||||
const content = fs.readFileSync(this.configPath, 'utf8')
|
||||
const loadedConfig = this.configPath.endsWith('.json')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue