Skip to content

Commit 0475484

Browse files
committed
Merge remote-tracking branch 'origin/master' into api-project-exec-async-7666
2 parents 63ca2e9 + dc90bef commit 0475484

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/packages/frontend/account/store.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export class AccountStore extends Store<AccountState> {
3838
this.get("is_logged_in"),
3939
this.get("email_address"),
4040
this.get("passports"),
41-
this.get("lti_id")
41+
this.get("lti_id"),
4242
);
4343
},
4444
dependencies: [
@@ -88,7 +88,7 @@ export class AccountStore extends Store<AccountState> {
8888
get_color(): string {
8989
return this.getIn(
9090
["profile", "color"],
91-
this.get("account_id", "f00").slice(0, 6)
91+
this.get("account_id", "f00").slice(0, 6),
9292
);
9393
}
9494

@@ -114,6 +114,10 @@ export class AccountStore extends Store<AccountState> {
114114
return stripe_data && get_total_upgrades(stripe_data.toJS());
115115
}
116116

117+
hasLegacyUpgrades = () => {
118+
return this.getIn(["stripe_customer", "subscriptions", "data"]) != null;
119+
};
120+
117121
// uses the total upgrades information to determine, if this is a paying member
118122
// TODO: this is not used anywhere; but, if it was, it should also take into account
119123
// being a license manager...
@@ -141,7 +145,7 @@ function is_anonymous(
141145
is_logged_in: boolean,
142146
email_address: string | undefined | null,
143147
passports: Map<string, any> | undefined | null,
144-
lti_id: List<string> | undefined | null
148+
lti_id: List<string> | undefined | null,
145149
): boolean {
146150
if (!is_logged_in) {
147151
return false;

src/packages/frontend/projects/create-project.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ export const NewProjectCreator: React.FC<Props> = ({
7272

7373
const is_anonymous = useTypedRedux("account", "is_anonymous");
7474
const customize_kucalc = useTypedRedux("customize", "kucalc");
75-
const requireLicense = !!useTypedRedux(
76-
"customize",
77-
"require_license_to_create_project",
78-
);
75+
const hasLegacyUpgrades = redux.getStore("account").hasLegacyUpgrades();
76+
const requireLicense =
77+
!hasLegacyUpgrades &&
78+
!!useTypedRedux("customize", "require_license_to_create_project");
7979
const [show_add_license, set_show_add_license] =
8080
useState<boolean>(requireLicense);
8181

0 commit comments

Comments
 (0)