Skip to content

Commit

Permalink
fix: duplication of samplerFields when importing custom template
Browse files Browse the repository at this point in the history
  • Loading branch information
Vali-98 committed Dec 24, 2024
1 parent cd1e47a commit bf5fd58
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions constants/API/APIManagerState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ const verifyJSON = (source: any, target: any): any => {
sourceObj = Array.isArray(targetObj) ? [] : {}
}
for (const key of Object.keys(targetObj)) {
if (key === 'samplerFields') continue
if (!(key in sourceObj)) {
sourceObj[key] = targetObj[key]
} else if (typeof targetObj[key] === 'object' && targetObj[key] !== null) {
Expand Down
5 changes: 4 additions & 1 deletion constants/SSEFetch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,10 @@ export class SSEFetch {
...body,
})

if (res.status !== 200 || !res.body) return this.onError()
if (res.status !== 200 || !res.body) {
Logger.log(await res.text())
return this.onError()
}
this.closeStream = res.body.cancel
for await (const chunk of res.body) {
const data = this.decoder.decode(chunk)
Expand Down

0 comments on commit bf5fd58

Please sign in to comment.