@@ -9,9 +9,9 @@ import { defineMessage, FormattedMessage, useIntl } from "react-intl";
9
9
10
10
import { default_filename } from "@cocalc/frontend/account" ;
11
11
import { Alert , Col , Row } from "@cocalc/frontend/antd-bootstrap" ;
12
- import { filenameIcon } from "@cocalc/frontend/file-associations" ;
13
12
import {
14
13
ProjectActions ,
14
+ redux ,
15
15
useActions ,
16
16
useRedux ,
17
17
useTypedRedux ,
@@ -27,9 +27,14 @@ import {
27
27
} from "@cocalc/frontend/components" ;
28
28
import FakeProgress from "@cocalc/frontend/components/fake-progress" ;
29
29
import ComputeServer from "@cocalc/frontend/compute/inline" ;
30
+ import { filenameIcon } from "@cocalc/frontend/file-associations" ;
30
31
import { FileUpload , UploadLink } from "@cocalc/frontend/file-upload" ;
31
32
import { labels } from "@cocalc/frontend/i18n" ;
32
33
import { special_filenames_with_no_extension } from "@cocalc/frontend/project-file" ;
34
+ import {
35
+ getValidVBAROption ,
36
+ VBAR_KEY ,
37
+ } from "@cocalc/frontend/project/page/vbar" ;
33
38
import { ProjectMap } from "@cocalc/frontend/todo-types" ;
34
39
import { filename_extension , is_only_downloadable } from "@cocalc/util/misc" ;
35
40
import { COLORS } from "@cocalc/util/theme" ;
@@ -330,9 +335,13 @@ export default function NewFilePage(props: Props) {
330
335
) ;
331
336
} ;
332
337
333
- const showFiles = ( ) => {
334
- actions . set_active_tab ( "files" ) ;
335
- } ;
338
+ function closeNewPage ( ) {
339
+ // Showing homepage in flyout only mode, otherwise the files as usual
340
+ const account_store = redux . getStore ( "account" ) as any ;
341
+ const vbar = account_store ?. getIn ( [ "other_settings" , VBAR_KEY ] ) ;
342
+ const pureFlyoutMode = getValidVBAROption ( vbar ) === "flyout" ;
343
+ actions ?. set_active_tab ( pureFlyoutMode ? "home" : "files" ) ;
344
+ }
336
345
337
346
//key is so autofocus works below
338
347
return (
@@ -412,7 +421,7 @@ export default function NewFilePage(props: Props) {
412
421
) }
413
422
</ div >
414
423
}
415
- close = { showFiles }
424
+ close = { closeNewPage }
416
425
>
417
426
< Modal
418
427
onCancel = { ( ) => setCreatingFile ( "" ) }
0 commit comments