Skip to content

Commit

Permalink
fix: Every time I open the application, I occasionally cannot select …
Browse files Browse the repository at this point in the history
…the database problem
  • Loading branch information
shanhexi committed Dec 18, 2023
1 parent 183d12d commit 999b5cf
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 7 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
## 3.1.15

`2023-12-18`

**Changelog**

- 🐞【Fixed】Every time I open the application, I occasionally cannot select the database problem
- 🐞【Fixed】Compatible with old data types can not show deletion problems

## 3.1.14

`2023-12-17`
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG_CN.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
## 3.1.15

`2023-12-18`

**更新日志**

- 🐞【修复】每次打开应用时,偶现无法选择数据库问题
- 🐞【修复】兼容老数据类型无法显示删除问题


## 3.1.14

`2023-12-17`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ const SelectBoundInfo = memo((props: IProps) => {

const supportDatabase = useMemo(() => {
return connectionList?.find((item) => item.id === boundInfo.dataSourceId)?.supportDatabase;
}, [boundInfo.dataSourceId]);
}, [boundInfo.dataSourceId,connectionList]);

const supportSchema = useMemo(() => {
return connectionList?.find((item) => item.id === boundInfo.dataSourceId)?.supportSchema;
}, [boundInfo.dataSourceId]);
}, [boundInfo.dataSourceId,connectionList]);

// 编辑器绑定的数据库类型变化时,重新注册智能提示
useEffect(() => {
Expand Down Expand Up @@ -105,8 +105,8 @@ const SelectBoundInfo = memo((props: IProps) => {

// 获取数据库列表
const getDatabaseList = () => {
if(boundInfo.dataSourceId === undefined || boundInfo.dataSourceId === null){
return
if (boundInfo.dataSourceId === undefined || boundInfo.dataSourceId === null) {
return;
}
connectionService
.getDatabaseList({
Expand Down Expand Up @@ -134,8 +134,8 @@ const SelectBoundInfo = memo((props: IProps) => {

// 获取schema列表
const getSchemaList = () => {
if(boundInfo.dataSourceId === undefined || boundInfo.dataSourceId === null){
return
if (boundInfo.dataSourceId === undefined || boundInfo.dataSourceId === null) {
return;
}
connectionService
.getSchemaList({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,8 @@ const WorkspaceTabs = memo(() => {
);
data.forEach((item) => {
const editData = workspaceTabList?.find((t) => t.id === item.key);
if (editData?.type === WorkspaceTabType.CONSOLE) {
// table 为了兼容老数据
if (editData?.type === WorkspaceTabType.CONSOLE || editData?.type === 'table' as any) {
closeWindowTab(item.key as number);
}
});
Expand Down Expand Up @@ -212,6 +213,7 @@ const WorkspaceTabs = memo(() => {
// 根据不同的tab类型渲染不同的内容
const workspaceTabConnectionMap = (item: IWorkspaceTab) => {
switch (item.type) {
case 'table' as any: // 为了兼容老数据
case WorkspaceTabType.CONSOLE:
case WorkspaceTabType.FUNCTION:
case WorkspaceTabType.PROCEDURE:
Expand Down

0 comments on commit 999b5cf

Please sign in to comment.