diff --git a/web/src/containers/Drive/main.tsx b/web/src/containers/Drive/main.tsx index c45484d..a8da137 100644 --- a/web/src/containers/Drive/main.tsx +++ b/web/src/containers/Drive/main.tsx @@ -24,8 +24,11 @@ const Main = (props: any) => { axios .get(`/SASjsApi/files?filePath=${props.selectedFilePath}`) .then((res: any) => { - setIsLoading(false) setFileContent(res.data.fileContent) + }).catch((err) => { + console.log(err) + }).finally(() => { + setIsLoading(false) }) } }, [props.selectedFilePath]) @@ -42,8 +45,11 @@ const Main = (props: any) => { fileContent: fileContent }) .then((res) => { - setIsLoading(false) setEditMode(false) + }).catch((err) => { + console.log(err) + }).finally(() => { + setIsLoading(false) }) } } diff --git a/web/src/containers/Drive/sideBar.tsx b/web/src/containers/Drive/sideBar.tsx index 8cb8e95..cbf033f 100644 --- a/web/src/containers/Drive/sideBar.tsx +++ b/web/src/containers/Drive/sideBar.tsx @@ -48,10 +48,12 @@ const SideBar = (props: any) => { if (res.data && res.data?.status === 'success') { setDirectoryData(res.data.tree) } + }).catch((err) => { + console.log(err) }) const queryParams = new URLSearchParams(location.search) props.setSelectedFilePath(queryParams.get('filePath')) - }, [location.search, props]) + }, []) const handleSelect = (node: TreeNode) => { if (!node.children.length) {