diff --git a/packages/playground/data-liberation-static-files-editor/ui/src/add-local-files-tab.tsx b/packages/playground/data-liberation-static-files-editor/ui/src/add-local-files-tab.tsx index 5ba672ed65..3674e9c581 100644 --- a/packages/playground/data-liberation-static-files-editor/ui/src/add-local-files-tab.tsx +++ b/packages/playground/data-liberation-static-files-editor/ui/src/add-local-files-tab.tsx @@ -42,15 +42,22 @@ export function addLocalFilesTab(tab: { function patchArguments(args: any[]) { let [type, props, ...children] = args; const newProps = { ...props }; - if ('tabs' in newProps) { - const hasLocalFilesTab = newProps.tabs.find( - (tab) => tab.name === 'local-files' - ); - if (!hasLocalFilesTab) { - newProps.tabs.unshift(tab); - } - newProps.defaultTabId = 'local-files'; + if (!('tabs' in newProps)) { + return [type, newProps, ...children]; } + const hasListViewTab = newProps.tabs.find( + (tab) => tab.name === 'list-view' + ); + if (!hasListViewTab) { + return [type, newProps, ...children]; + } + const hasLocalFilesTab = newProps.tabs.find( + (tab) => tab.name === 'local-files' + ); + if (!hasLocalFilesTab) { + newProps.tabs.unshift(tab); + } + newProps.defaultTabId = 'local-files'; return [type, newProps, ...children]; }