Skip to content

Commit

Permalink
fix: fix console error (#438)
Browse files Browse the repository at this point in the history
* fix: console error

* mod: code review
  • Loading branch information
hetao92 authored Jan 31, 2023
1 parent a86b81e commit 12d35dd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/stores/console.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export class ConsoleStore {
}
}
const { gqlList, paramList } = splitQuery(gql);
const data = await service.batchExecNGQL(
const { code, data } = await service.batchExecNGQL(
{
gqls: gqlList
.filter((item) => item !== '')
Expand All @@ -110,7 +110,10 @@ export class ConsoleStore {
},
},
);
data.data.forEach((item) => {
if (code !== 0) {
return;
}
data?.forEach((item) => {
item.id = uuidv4();
item.space = this.currentSpace;
item.spaceVidType = spaceVidType;
Expand All @@ -122,7 +125,7 @@ export class ConsoleStore {
if (updateQuerys.length > 0) {
await this.getParams();
}
const _results = [...data.data.reverse(), ...this.results];
const _results = [...data?.reverse(), ...this.results];
this.update({
results: _results,
currentGQL: editorValue || gql,
Expand Down
1 change: 1 addition & 0 deletions server/api/studio/pkg/ws/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ func (c *Client) writePump() {
c.conn.SetWriteDeadline(time.Now().Add(writeWait))
if !ok {
// The hub closed the channel.
logx.Errorf("[WebSocket UnexpectedClose]: c.send length: %v", len(c.send))
c.conn.WriteMessage(websocket.CloseMessage, []byte{})
return
}
Expand Down

0 comments on commit 12d35dd

Please sign in to comment.