|
3 | 3 | * License: MS-RSL – see LICENSE.md for details
|
4 | 4 | */
|
5 | 5 |
|
6 |
| -import { AccountStore } from "@cocalc/frontend/account"; |
7 |
| -import { redux } from "@cocalc/frontend/app-framework"; |
8 | 6 | import { ACTIVITY_BAR_OPTIONS } from "./activity-bar-consts";
|
9 | 7 |
|
10 |
| -const FLYOUT_DEFAULT_DATE = new Date("2100-01-01"); |
11 |
| - |
12 |
| -// New users created after this date will have the default activity bar option set to "flyout" |
13 |
| -function getDefaultActivityBarOption() { |
14 |
| - const store: AccountStore = redux.getStore("account"); |
15 |
| - if (store == null) return "both"; |
16 |
| - const created = store.get("created"); |
17 |
| - // check that created is a Date |
18 |
| - if (created == null || !(created instanceof Date)) return "both"; |
19 |
| - // if created is after this date return "flyout", else "both" |
20 |
| - if (created > FLYOUT_DEFAULT_DATE) { |
21 |
| - return "flyout"; |
22 |
| - } else { |
23 |
| - return "both"; |
24 |
| - } |
| 8 | +// If not set, default is full pages |
| 9 | +// https://github.com/sagemathinc/cocalc/issues/8475 |
| 10 | +function getDefaultActivityBarOption(): keyof typeof ACTIVITY_BAR_OPTIONS { |
| 11 | + return "full"; |
25 | 12 | }
|
26 | 13 |
|
27 | 14 | export function getValidActivityBarOption(
|
28 |
| - vbar_setting: any, |
| 15 | + activityBarSetting: any, |
29 | 16 | ): keyof typeof ACTIVITY_BAR_OPTIONS {
|
30 |
| - if (typeof vbar_setting !== "string" || ACTIVITY_BAR_OPTIONS[vbar_setting] == null) { |
| 17 | + if ( |
| 18 | + typeof activityBarSetting !== "string" || |
| 19 | + ACTIVITY_BAR_OPTIONS[activityBarSetting] == null |
| 20 | + ) { |
31 | 21 | return getDefaultActivityBarOption();
|
32 | 22 | }
|
33 |
| - return vbar_setting as keyof typeof ACTIVITY_BAR_OPTIONS; |
| 23 | + return activityBarSetting as keyof typeof ACTIVITY_BAR_OPTIONS; |
34 | 24 | }
|
0 commit comments