Skip to content

Commit

Permalink
fix an issue with empty dataset folders
Browse files Browse the repository at this point in the history
  • Loading branch information
hotzenklotz committed May 17, 2023
1 parent 96c6525 commit df0a41b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions frontend/javascripts/dashboard/dataset_folder_view.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { EditFolderModal } from "./folders/edit_folder_modal";
import { FolderTreeSidebar } from "./folders/folder_tree";
import features, { getDemoDatasetUrl } from "features";
import { RenderToPortal } from "oxalis/view/layouting/portal_utils";
import { useFolderHierarchyQuery } from "./dataset/queries";

type Props = {
user: APIUser;
Expand All @@ -30,6 +31,7 @@ function DatasetFolderViewInner(props: Props) {
const context = useDatasetCollectionContext();
const { selectedDatasets, setSelectedDatasets } = context;
const [folderIdForEditModal, setFolderIdForEditModal] = useState<string | null>(null);
const { data: hierarchy } = useFolderHierarchyQuery();

const setSelectedDataset = (ds: APIDatasetCompact | null, multiSelect?: boolean) => {
if (!ds) {
Expand Down Expand Up @@ -139,7 +141,7 @@ function DatasetFolderViewInner(props: Props) {

return (
<React.Fragment>
<RenderToPortal portalId="dashboard-TabBarExtraContent">{adminHeader}</RenderToPortal>;
<RenderToPortal portalId="dashboard-TabBarExtraContent">{adminHeader}</RenderToPortal>
<Row
justify="center"
style={{
Expand All @@ -155,7 +157,7 @@ function DatasetFolderViewInner(props: Props) {
);
};

if (context.datasets.length === 0) {
if (hierarchy != null && hierarchy.flatItems.length === 1 && context.datasets.length === 0) {
return renderNoDatasetsPlaceHolder();
}

Expand Down

0 comments on commit df0a41b

Please sign in to comment.