@@ -167,37 +167,37 @@ function linkCmd() {
167
167
168
168
// Ask the user which project they want to upload each diagram to
169
169
const getProjectId : LinkOptions [ 'getProjectId' ] = async ( cache , documentTitle ) => {
170
- if ( cache . previousSelectedProjectId !== undefined ) {
171
- if ( cache . usePreviousSelectedProjectId === undefined ) {
172
- cache . usePreviousSelectedProjectId = confirm ( {
173
- message : `Would you like to upload all diagrams to this project?` ,
174
- default : true ,
175
- } ) ;
176
- }
177
- if ( await cache . usePreviousSelectedProjectId ) {
178
- return cache . previousSelectedProjectId ;
179
- }
180
- }
181
-
182
- cache . projects = cache . projects ?? client . getProjects ( ) ;
183
- const projectId = await select ( {
184
- message : `Select a project to upload ${ documentTitle } to` ,
185
- choices : [
186
- ...( await cache . projects ) . map ( ( project ) => {
187
- return {
188
- name : project . title ,
189
- value : project . id ,
190
- } ;
191
- } ) ,
192
- new Separator (
193
- `Or go to ${ new URL ( '/app/projects' , client . baseURL ) } to create a new project` ,
194
- ) ,
195
- ] ,
170
+ if ( cache . previousSelectedProjectId !== undefined ) {
171
+ if ( cache . usePreviousSelectedProjectId === undefined ) {
172
+ cache . usePreviousSelectedProjectId = confirm ( {
173
+ message : `Would you like to upload all diagrams to this project?` ,
174
+ default : true ,
196
175
} ) ;
176
+ }
177
+ if ( await cache . usePreviousSelectedProjectId ) {
178
+ return cache . previousSelectedProjectId ;
179
+ }
180
+ }
181
+
182
+ cache . projects = cache . projects ?? client . getProjects ( ) ;
183
+ const projectId = await select ( {
184
+ message : `Select a project to upload ${ documentTitle } to` ,
185
+ choices : [
186
+ ...( await cache . projects ) . map ( ( project ) => {
187
+ return {
188
+ name : project . title ,
189
+ value : project . id ,
190
+ } ;
191
+ } ) ,
192
+ new Separator (
193
+ `Or go to ${ new URL ( '/app/projects' , client . baseURL ) } to create a new project` ,
194
+ ) ,
195
+ ] ,
196
+ } ) ;
197
197
198
- cache . previousSelectedProjectId = projectId ;
198
+ cache . previousSelectedProjectId = projectId ;
199
199
200
- return projectId ;
200
+ return projectId ;
201
201
} ;
202
202
203
203
const linkCache = { } ;
0 commit comments