Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

fix logic for when to fetch enc columns

Joshen Lim8aadf1cff4d6
diff --git a/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx b/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx
index e63f73c19bf..7e410f7d2ab 100644
--- a/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx
+++ b/studio/components/interfaces/TableGridEditor/SidePanelEditor/SidePanelEditor.tsx
@@ -2,12 +2,7 @@ import { FC, useState } from 'react'
import { find, isEmpty, isUndefined } from 'lodash'
import { Query, Dictionary } from 'components/grid'
import { Modal } from 'ui'
-import {
- PostgresRelationship,
- PostgresTable,
- PostgresColumn,
- PostgresType,
-} from '@supabase/postgres-meta'
+import { PostgresRelationship, PostgresTable, PostgresColumn } from '@supabase/postgres-meta'
import { useStore } from 'hooks'
import { RowEditor, ColumnEditor, TableEditor } from '.'
diff --git a/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx b/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx
index 1b924b69d2f..818f0d97832 100644
--- a/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx
+++ b/studio/components/interfaces/TableGridEditor/TableGridEditor.tsx
@@ -67,10 +67,10 @@ const TableGridEditor: FC<Props> = ({
}
useEffect(() => {
- if (selectedTable !== undefined) {
+ if (selectedTable !== undefined && selectedTable.id !== undefined) {
getEncryptedColumns(selectedTable)
}
- }, [selectedTable])
+ }, [selectedTable?.id])
if (isUndefined(selectedTable)) {
return <NotFoundState id={Number(router.query.id)} />
@@ -107,8 +107,7 @@ const TableGridEditor: FC<Props> = ({
}
const onColumnSaved = (hasEncryptedColumns = false) => {
- if (hasEncryptedColumns) {
- }
+ if (hasEncryptedColumns) getEncryptedColumns(selectedTable)
}
const onTableCreated = (table: PostgresTable) => {