Fix websocket error
This commit is contained in:
parent
0c72d08763
commit
fdfedfdd92
|
@ -104,8 +104,6 @@ export const createActions = context => {
|
||||||
instanceLoaded.set(false)
|
instanceLoaded.set(false)
|
||||||
loading.set(true)
|
loading.set(true)
|
||||||
|
|
||||||
console.log($datasource)
|
|
||||||
|
|
||||||
// Abandon if we don't have a valid datasource
|
// Abandon if we don't have a valid datasource
|
||||||
if (!$datasource?.tableId) {
|
if (!$datasource?.tableId) {
|
||||||
return
|
return
|
||||||
|
@ -270,7 +268,6 @@ export const createActions = context => {
|
||||||
} else {
|
} else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
console.log(newRow)
|
|
||||||
newRow = await API.saveRow(newRow, SuppressErrors)
|
newRow = await API.saveRow(newRow, SuppressErrors)
|
||||||
|
|
||||||
// Update state
|
// Update state
|
||||||
|
|
|
@ -21,8 +21,13 @@ export default class GridSocket extends BaseSocket {
|
||||||
async onConnect(socket: Socket) {
|
async onConnect(socket: Socket) {
|
||||||
// Initial identification of connected spreadsheet
|
// Initial identification of connected spreadsheet
|
||||||
socket.on(
|
socket.on(
|
||||||
GridSocketEvent.SelectTable,
|
GridSocketEvent.SelectDatasource,
|
||||||
async ({ tableId, appId }, callback) => {
|
async ({ datasource, appId }, callback) => {
|
||||||
|
if (datasource?.type !== "table") {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
const tableId = datasource.tableId
|
||||||
|
|
||||||
// Ignore if no table or app specified
|
// Ignore if no table or app specified
|
||||||
if (!tableId || !appId) {
|
if (!tableId || !appId) {
|
||||||
socket.disconnect(true)
|
socket.disconnect(true)
|
||||||
|
|
|
@ -77,7 +77,7 @@ export enum SocketEvent {
|
||||||
export enum GridSocketEvent {
|
export enum GridSocketEvent {
|
||||||
RowChange = "RowChange",
|
RowChange = "RowChange",
|
||||||
TableChange = "TableChange",
|
TableChange = "TableChange",
|
||||||
SelectTable = "SelectTable",
|
SelectDatasource = "SelectDatasource",
|
||||||
SelectCell = "SelectCell",
|
SelectCell = "SelectCell",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue