@@ -13,7 +13,7 @@ import {
13
13
import { PersistenceFile } from 'src/features/persistence/PersistenceTypes' ;
14
14
import classes from 'src/styles/FileSystemView.module.scss' ;
15
15
16
- import { rmdirRecursively } from '../fileSystem/FileSystemUtils' ;
16
+ import { isGDriveSyncing , isGithubSyncing , rmdirRecursively } from '../fileSystem/FileSystemUtils' ;
17
17
import { showSimpleConfirmDialog , showSimpleErrorDialog } from '../utils/DialogHelper' ;
18
18
import { removeEditorTabsForDirectory } from '../workspace/WorkspaceActions' ;
19
19
import { WorkspaceLocation } from '../workspace/WorkspaceTypes' ;
@@ -90,8 +90,12 @@ const FileSystemViewDirectoryNode: React.FC<Props> = ({
90
90
if ( ! shouldProceed ) {
91
91
return ;
92
92
}
93
- dispatch ( persistenceDeleteFolder ( fullPath ) ) ;
94
- dispatch ( githubDeleteFolder ( fullPath ) ) ;
93
+ if ( isGDriveSyncing ( ) ) {
94
+ dispatch ( persistenceDeleteFolder ( fullPath ) ) ;
95
+ }
96
+ if ( isGithubSyncing ( ) ) {
97
+ dispatch ( githubDeleteFolder ( fullPath ) ) ;
98
+ }
95
99
dispatch ( removeEditorTabsForDirectory ( workspaceLocation , fullPath ) ) ;
96
100
rmdirRecursively ( fileSystem , fullPath ) . then ( refreshParentDirectory ) ;
97
101
} ) ;
@@ -124,8 +128,12 @@ const FileSystemViewDirectoryNode: React.FC<Props> = ({
124
128
if ( err ) {
125
129
console . error ( err ) ;
126
130
}
127
- dispatch ( persistenceCreateFile ( newFilePath ) ) ;
128
- dispatch ( githubCreateFile ( newFilePath ) ) ;
131
+ if ( isGDriveSyncing ( ) ) {
132
+ dispatch ( persistenceCreateFile ( newFilePath ) ) ;
133
+ }
134
+ if ( isGithubSyncing ( ) ) {
135
+ dispatch ( githubCreateFile ( newFilePath ) ) ;
136
+ }
129
137
forceRefreshFileSystemViewList ( ) ;
130
138
} ) ;
131
139
} ) ;
@@ -155,6 +163,24 @@ const FileSystemViewDirectoryNode: React.FC<Props> = ({
155
163
}
156
164
157
165
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());
158
184
forceRefreshFileSystemViewList ( ) ;
159
185
} ) ;
160
186
} ) ;
0 commit comments