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