@@ -13,13 +13,13 @@ const log = getLogger("server:accounts:creation-actions");
1313export default async function accountCreationActions (
1414 email_address : string ,
1515 account_id : string ,
16- tags ?: string [ ]
16+ tags ?: string [ ] ,
1717) : Promise < void > {
1818 log . debug ( { account_id, email_address, tags } ) ;
1919 const pool = getPool ( ) ;
2020 const { rows } = await pool . query (
2121 "SELECT action FROM account_creation_actions WHERE email_address=$1 AND expire > NOW()" ,
22- [ email_address ]
22+ [ email_address ] ,
2323 ) ;
2424 let numProjects = 0 ;
2525 for ( const { action } of rows ) {
@@ -32,17 +32,12 @@ export default async function accountCreationActions(
3232 }
3333 }
3434 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
3737 // You're a new user with no known "reason"
3838 // 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.
4641 // NOTE -- wrapped in closure, since do NOT block on this:
4742 ( async ( ) => {
4843 try {
@@ -70,6 +65,6 @@ export async function creationActionsDone(account_id: string): Promise<void> {
7065 const pool = getPool ( ) ;
7166 await pool . query (
7267 "UPDATE accounts SET creation_actions_done=true WHERE account_id=$1::UUID" ,
73- [ account_id ]
68+ [ account_id ] ,
7469 ) ;
7570}
0 commit comments