Skip to content

Commit 5b90ad3

Browse files
committed
prevent api call
1 parent 5b56308 commit 5b90ad3

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • webapp/src/routes/_authenticated/studies/$studyId/explore/debug

webapp/src/routes/_authenticated/studies/$studyId/explore/debug/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,11 @@ function Debug() {
4242
// Allow to keep expanded items when the tree is reloaded with `reloadTree`
4343
const [expandedItems, setExpandedItems] = useState<string[]>([]);
4444
const { path } = Route.useSearch();
45+
const isFilesystemStudy = study.storageMode === "filesystem";
4546

4647
const treeDataResponse = usePromiseWithSnackbarError(() => getTreeData(study.id), {
4748
errorMessage: t("studies.error.retrieveData"),
49+
disabled: !isFilesystemStudy,
4850
deps: [study.id],
4951
});
5052

@@ -108,7 +110,7 @@ function Debug() {
108110
// JSX
109111
////////////////////////////////////////////////////////////////
110112

111-
if (study.storageMode !== "filesystem") {
113+
if (!isFilesystemStudy) {
112114
throw new Error(`${Route.path} is only available for studies with filesystem storage mode.`);
113115
}
114116

0 commit comments

Comments
 (0)