Cleanup
This commit is contained in:
parent
359fef7ab4
commit
7c0a5f8442
|
@ -16,7 +16,7 @@ service cloud.firestore {
|
|||
allow read;
|
||||
allow update: if resource.data.id == request.auth.uid
|
||||
&& request.resource.data.diff(resource.data).affectedKeys()
|
||||
.hasOnly(['bio', 'bannerUrl', 'website', 'twitterHandle', 'discordHandle', 'followedCategories', 'referredByUserId']);
|
||||
.hasOnly(['bio', 'bannerUrl', 'website', 'twitterHandle', 'discordHandle', 'followedCategories', 'referredByUserId', 'referredByContractId']);
|
||||
}
|
||||
|
||||
match /{somePath=**}/portfolioHistory/{portfolioHistoryId} {
|
||||
|
|
|
@ -5,15 +5,6 @@ import { User } from 'common/user'
|
|||
import { Manalink } from 'common/manalink'
|
||||
import { runTxn, TxnData } from './transact'
|
||||
|
||||
// if the userId claiming the manalink just signed up:
|
||||
// - the manalink funds come from the house
|
||||
// -
|
||||
// if the manalink has a refergroupid:
|
||||
// - add the user to the group
|
||||
// in on-create-txn detect if it was a referral bonus, create notification for both parties
|
||||
// necessary for manalink: authentication from fromUser
|
||||
// - sending user's funds
|
||||
// - allowing new user to join closed group
|
||||
export const claimManalink = functions
|
||||
.runWith({ minInstances: 1 })
|
||||
.https.onCall(async (slug: string, context) => {
|
||||
|
|
|
@ -78,7 +78,7 @@ export const onUpdateUser = functions.firestore
|
|||
}
|
||||
|
||||
const txnDoc = await firestore.collection(`txns/`).doc(txn.id)
|
||||
await transaction.set(txnDoc, removeUndefinedProps(txn))
|
||||
await transaction.set(txnDoc, txn)
|
||||
console.log('created referral with txn id:', txn.id)
|
||||
transaction.update(referredByUserDoc, {
|
||||
balance: referredByUser.balance + referralAmount,
|
||||
|
|
|
@ -201,21 +201,6 @@ export function listenForLogin(onUser: (user: User | null) => void) {
|
|||
})
|
||||
}
|
||||
|
||||
// create new signup banner on markets for referrees
|
||||
// markets that someone signs up to bet on are referred to the market's creator
|
||||
// it would be great if you could invite someone to your group/allowlist their email
|
||||
// invite a user to your group with a unique link
|
||||
// pass the referrer id to this function
|
||||
// add the referrer id to the new user's field
|
||||
// in on-update-user check if the new user had a referrer,add the new user's ide to the referrees field
|
||||
// create a txn for both
|
||||
// create on-create-txn that checks why it was created, create a notification for it
|
||||
|
||||
// manalinks no required for:
|
||||
// referral from: user to site, user to another user's market, open group, implicit from market creator
|
||||
// from groups or market page, get the manalink id from the url and pass it here
|
||||
// then claim it upon successful signup
|
||||
//
|
||||
export async function firebaseLogin() {
|
||||
const provider = new GoogleAuthProvider()
|
||||
return signInWithPopup(auth, provider)
|
||||
|
|
Loading…
Reference in New Issue
Block a user