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) {
|
if (!target.__isSaving) {
|
||||||
target.__isSaving = true
|
target.__isSaving = true
|
||||||
this.saveToFile()
|
try {
|
||||||
target.__isSaving = false
|
this.saveToFile()
|
||||||
|
} finally {
|
||||||
|
target.__isSaving = false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|
@ -287,6 +290,7 @@ class ChatGPTConfig {
|
||||||
* Load config from file
|
* Load config from file
|
||||||
*/
|
*/
|
||||||
loadFromFile () {
|
loadFromFile () {
|
||||||
|
this.__isSaving = false;
|
||||||
try {
|
try {
|
||||||
const content = fs.readFileSync(this.configPath, 'utf8')
|
const content = fs.readFileSync(this.configPath, 'utf8')
|
||||||
const loadedConfig = this.configPath.endsWith('.json')
|
const loadedConfig = this.configPath.endsWith('.json')
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue