Skip to content

Commit 8898a9c

Browse files
authored
Merge pull request #8476 from sagemathinc/frontend-chg-dflt-actionbar-8475
frontend/activity bar: make full pages the default for everyone
2 parents 068ded6 + 0b8b075 commit 8898a9c

File tree

1 file changed

+10
-20
lines changed

1 file changed

+10
-20
lines changed

src/packages/frontend/project/page/activity-bar.tsx

Lines changed: 10 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,22 @@
33
* License: MS-RSL – see LICENSE.md for details
44
*/
55

6-
import { AccountStore } from "@cocalc/frontend/account";
7-
import { redux } from "@cocalc/frontend/app-framework";
86
import { ACTIVITY_BAR_OPTIONS } from "./activity-bar-consts";
97

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";
2512
}
2613

2714
export function getValidActivityBarOption(
28-
vbar_setting: any,
15+
activityBarSetting: any,
2916
): 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+
) {
3121
return getDefaultActivityBarOption();
3222
}
33-
return vbar_setting as keyof typeof ACTIVITY_BAR_OPTIONS;
23+
return activityBarSetting as keyof typeof ACTIVITY_BAR_OPTIONS;
3424
}

0 commit comments

Comments
 (0)