@@ -216,6 +216,46 @@ function* githubSaveAll(): any {
216
216
type GetAuthenticatedResponse = GetResponseTypeFromEndpointMethod <
217
217
typeof octokit . users . getAuthenticated
218
218
> ;
219
+
220
+ if ( store . getState ( ) . fileSystem . persistenceFileArray . length === 0 ) {
221
+ type ListForAuthenticatedUserData = GetResponseDataTypeFromEndpointMethod <
222
+ typeof octokit . repos . listForAuthenticatedUser
223
+ > ;
224
+ const userRepos : ListForAuthenticatedUserData = yield call (
225
+ async ( ) =>
226
+ await octokit . paginate ( octokit . repos . listForAuthenticatedUser , {
227
+ // 100 is the maximum number of results that can be retrieved per page.
228
+ per_page : 100
229
+ } )
230
+ ) ;
231
+
232
+ const getRepoName = async ( ) =>
233
+ await promisifyDialog < RepositoryDialogProps , string > ( RepositoryDialog , resolve => ( {
234
+ userRepos : userRepos ,
235
+ onSubmit : resolve
236
+ } ) ) ;
237
+ const repoName = yield call ( getRepoName ) ;
238
+
239
+ const editorContent = '' ;
240
+
241
+ if ( repoName !== '' ) {
242
+ const pickerType = 'Saveall' ;
243
+ const promisifiedDialog = async ( ) =>
244
+ await promisifyDialog < FileExplorerDialogProps , string > ( FileExplorerDialog , resolve => ( {
245
+ repoName : repoName ,
246
+ pickerType : pickerType ,
247
+ octokit : octokit ,
248
+ editorContent : editorContent ,
249
+ onSubmit : resolve
250
+ } ) ) ;
251
+
252
+ yield call ( promisifiedDialog ) ;
253
+ }
254
+ }
255
+
256
+
257
+
258
+
219
259
const authUser : GetAuthenticatedResponse = yield call ( octokit . users . getAuthenticated ) ;
220
260
221
261
const githubLoginId = authUser . data . login ;
0 commit comments