@@ -13,13 +13,13 @@ const log = getLogger("server:accounts:creation-actions");
13
13
export default async function accountCreationActions (
14
14
email_address : string ,
15
15
account_id : string ,
16
- tags ?: string [ ]
16
+ tags ?: string [ ] ,
17
17
) : Promise < void > {
18
18
log . debug ( { account_id, email_address, tags } ) ;
19
19
const pool = getPool ( ) ;
20
20
const { rows } = await pool . query (
21
21
"SELECT action FROM account_creation_actions WHERE email_address=$1 AND expire > NOW()" ,
22
- [ email_address ]
22
+ [ email_address ] ,
23
23
) ;
24
24
let numProjects = 0 ;
25
25
for ( const { action } of rows ) {
@@ -32,17 +32,12 @@ export default async function accountCreationActions(
32
32
}
33
33
}
34
34
log . debug ( "added user to" , numProjects , "projects" ) ;
35
- if ( numProjects == 0 && tags != null && tags . length > 0 ) {
36
- // didn't get added to any projects, but there are some explicit tags.
35
+ if ( numProjects == 0 ) {
36
+ // didn't get added to any projects
37
37
// You're a new user with no known "reason"
38
38
// to use CoCalc, except that you found the page and signed up. You are
39
- // VERY likely to create a project next, or you wouldn't be here. The only
40
- // exception I can think of is accounting people (e.g., in the store) making
41
- // an enterprise purchase, and that is probably 0.01% of users, and likely
42
- // that sign in flow won't have tags set anyways, so won't end up here.
43
- // Also directly creating accounts via the api wouldn't have tags set.
44
- // So we create an account for you now to increase your chance of success,
45
- // since you tagged some things.
39
+ // VERY likely to create a project next, or you wouldn't be here.
40
+ // So we create a project for you now to increase your chance of success.
46
41
// NOTE -- wrapped in closure, since do NOT block on this:
47
42
( async ( ) => {
48
43
try {
@@ -70,6 +65,6 @@ export async function creationActionsDone(account_id: string): Promise<void> {
70
65
const pool = getPool ( ) ;
71
66
await pool . query (
72
67
"UPDATE accounts SET creation_actions_done=true WHERE account_id=$1::UUID" ,
73
- [ account_id ]
68
+ [ account_id ] ,
74
69
) ;
75
70
}
0 commit comments