@@ -13,7 +13,7 @@ import {
1313import { PersistenceFile } from 'src/features/persistence/PersistenceTypes' ;
1414import classes from 'src/styles/FileSystemView.module.scss' ;
1515
16- import { rmdirRecursively } from '../fileSystem/FileSystemUtils' ;
16+ import { isGDriveSyncing , isGithubSyncing , rmdirRecursively } from '../fileSystem/FileSystemUtils' ;
1717import { showSimpleConfirmDialog , showSimpleErrorDialog } from '../utils/DialogHelper' ;
1818import { removeEditorTabsForDirectory } from '../workspace/WorkspaceActions' ;
1919import { WorkspaceLocation } from '../workspace/WorkspaceTypes' ;
@@ -90,8 +90,12 @@ const FileSystemViewDirectoryNode: React.FC<Props> = ({
9090 if ( ! shouldProceed ) {
9191 return ;
9292 }
93- dispatch ( persistenceDeleteFolder ( fullPath ) ) ;
94- dispatch ( githubDeleteFolder ( fullPath ) ) ;
93+ if ( isGDriveSyncing ( ) ) {
94+ dispatch ( persistenceDeleteFolder ( fullPath ) ) ;
95+ }
96+ if ( isGithubSyncing ( ) ) {
97+ dispatch ( githubDeleteFolder ( fullPath ) ) ;
98+ }
9599 dispatch ( removeEditorTabsForDirectory ( workspaceLocation , fullPath ) ) ;
96100 rmdirRecursively ( fileSystem , fullPath ) . then ( refreshParentDirectory ) ;
97101 } ) ;
@@ -124,8 +128,12 @@ const FileSystemViewDirectoryNode: React.FC<Props> = ({
124128 if ( err ) {
125129 console . error ( err ) ;
126130 }
127- dispatch ( persistenceCreateFile ( newFilePath ) ) ;
128- dispatch ( githubCreateFile ( newFilePath ) ) ;
131+ if ( isGDriveSyncing ( ) ) {
132+ dispatch ( persistenceCreateFile ( newFilePath ) ) ;
133+ }
134+ if ( isGithubSyncing ( ) ) {
135+ dispatch ( githubCreateFile ( newFilePath ) ) ;
136+ }
129137 forceRefreshFileSystemViewList ( ) ;
130138 } ) ;
131139 } ) ;
@@ -155,6 +163,24 @@ const FileSystemViewDirectoryNode: React.FC<Props> = ({
155163 }
156164
157165 dispatch ( persistenceCreateFolder ( newDirectoryPath ) ) ;
166+ // function informUserGithubCannotCreateFolder() {
167+ // return showSimpleConfirmDialog({
168+ // contents: (
169+ // <div>
170+ // <p>
171+ // Warning: Github is unable to create empty directories. When you create your first
172+ // file in this folder, Github will automatically sync this folder and the first
173+ // file.
174+ // </p>
175+ // <p>Please click 'Confirm' to continue.</p>
176+ // </div>
177+ // ),
178+ // positiveIntent: 'primary',
179+ // positiveLabel: 'Confirm'
180+ // });
181+ // }
182+ // informUserGithubCannotCreateFolder();
183+ // dispatch(enableFileSystemContextMenus());
158184 forceRefreshFileSystemViewList ( ) ;
159185 } ) ;
160186 } ) ;
0 commit comments