From 197d56a29b1106b1af8451adfe0d12ed3195fd5a Mon Sep 17 00:00:00 2001 From: Aditya Bist Date: Fri, 8 Apr 2022 11:10:30 -0700 Subject: [PATCH] Fix new table issue (#18974) * fix new table issue * fix new table scenario * simplify logic --- .../browser/editor/tableDesigner/tableDesignerInput.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/sql/workbench/browser/editor/tableDesigner/tableDesignerInput.ts b/src/sql/workbench/browser/editor/tableDesigner/tableDesignerInput.ts index 726cc28696..cfb9cd11a8 100644 --- a/src/sql/workbench/browser/editor/tableDesigner/tableDesignerInput.ts +++ b/src/sql/workbench/browser/editor/tableDesigner/tableDesignerInput.ts @@ -56,7 +56,9 @@ export class TableDesignerInput extends EditorInput { this._onDidChangeDirty.fire(); } })); - this._tableIcon = tableInfo.tableIcon.toString() === '' ? TableIcon.Basic : tableInfo.tableIcon as TableIcon; + + // default to basic if icon is null (new table) or no sub type + this._tableIcon = tableInfo.tableIcon ? tableInfo.tableIcon as TableIcon : TableIcon.Basic; this.setEditorLabel(); }