mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-18 06:17:06 +00:00
fix: 很多功能
This commit is contained in:
parent
a711ec13d7
commit
66905640e4
15 changed files with 242 additions and 29 deletions
|
|
@ -28,7 +28,7 @@ export class LowDBChatPresetsStorage extends ChaiteStorage {
|
|||
if (!obj) {
|
||||
return null
|
||||
}
|
||||
return new ChatPreset({}).fromString(JSON.stringify(obj))
|
||||
return new ChatPreset(obj)
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -38,7 +38,7 @@ export class LowDBChatPresetsStorage extends ChaiteStorage {
|
|||
* @returns {Promise<string>}
|
||||
*/
|
||||
async setItem (id, preset) {
|
||||
if (id) {
|
||||
if (id && await this.getItem(id)) {
|
||||
await this.collection.updateById(id, preset)
|
||||
return id
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue