Commit Graph

389 Commits

Author SHA1 Message Date
Ian Philips
39c312cf9f Explicitly pass utc timezone 2022-08-19 15:19:52 -06:00
Ian Philips
1196ec4375 Send 6 trending emails to all users monday 12pm PT 2022-08-19 15:01:53 -06:00
Ian Philips
634196d8f1 Slice the popular emails to the top 20 2022-08-19 14:45:04 -06:00
Ian Philips
36bfbe8f42 Change betting streak modal, tweak trending email query 2022-08-19 14:37:16 -06:00
Ian Philips
a0f62ba172
Markets emails (#764)
* Send out email template for 3 trending markets

* Rich text to plaintext descriptions, other ui changes

* Lint

* Filter for closed markets

* Change sign

* First order must be closeTime

* Send 6 emails, check flag twice

* Exclude contracts with trump and president in the name

* interesting markets email

* sendInterestingMarketsEmail

* Change subject line back

Co-authored-by: mantikoros <sgrugett@gmail.com>
2022-08-19 11:43:57 -06:00
Ian Philips
00c9fa61c3
betting streaks (#777)
* Parse notif, show betting streaks modal, schedule function

* Ignore streaks of 0

* Pass notifyFills the contract

* Turn 9am into a constant

* Lint

* Up streak reward, fix timing logic

* Change wording
2022-08-19 11:10:32 -06:00
Marshall Polaris
0972de9025
Make typing for comments more fancy (#776) 2022-08-19 01:06:40 -07:00
Marshall Polaris
06ced7042d Fix a typo in my script 2022-08-18 12:49:01 -07:00
Marshall Polaris
c37997bcb7
Add comment type field to comments (#772) 2022-08-18 12:47:35 -07:00
mantikoros
d216b298ba "create-contract.ts" => "create-market.ts" 2022-08-18 11:14:16 -05:00
mantikoros
56e9b5fa2f create contract: ante no longer user liquidity provision 2022-08-18 11:14:16 -05:00
mantikoros
87561503c1 accept challenge: redeem shares 2022-08-18 10:39:48 -05:00
mantikoros
159723ed0c market creation email 2022-08-17 17:36:52 -05:00
mantikoros
bf64f5b3a9 redirect /about; more content in welcome email 2022-08-17 11:21:29 -05:00
James Grugett
770a8d049c Check limit prob with floating equals 2022-08-17 10:55:47 -05:00
Sinclair Chen
59565416b6
Api fixes (#704)
* Add min, max, isLogScale to numeric market API return

* Add lastUpdatedTime to market API

* Return a string description in market API

* Accept string descriptions in market POST api

* install prettier eslint config. fix import

* fix another import
2022-08-16 15:01:03 -07:00
James Grugett
814c4aa01d Change limit prob validation to be only on Binary markets (not numeric) 2022-08-16 15:44:58 -05:00
mantikoros
c58ed8bd2c personal followup email 2022-08-16 11:45:58 -05:00
mantikoros
c3eaf0351b one week email changes 2022-08-16 11:44:01 -05:00
Marshall Polaris
59ca1f7640
Denormalize some contract comment fields (#760)
* Make `groupConsecutive` more capable

* Put denormalized `contractQuestion` and `contractSlug` on comments

* Update user profile UI to use new denormalized fields

* `/Austin` -> `/market`
2022-08-15 22:43:46 -07:00
Marshall Polaris
d00fe7bcd2
Backend robustness to email sending or analytics tracking failures (#728)
* Make `sendEmail` functions await email send success

* Make tracking and email sending not throw on failure
2022-08-15 22:13:38 -07:00
Marshall Polaris
186befd0ac
Bail out earlier if createmarket is called with invalid group ID (#745)
* Bail out earlier if `createmarket` is called with invalid group ID

* Fix typing in `createmarket`
2022-08-15 22:12:43 -07:00
James Grugett
f2f77cb51e Resolve market emails: fix negative amount bug with better invested calculation 2022-08-15 21:48:01 -05:00
mantikoros
5c49461449 new welcome email 2022-08-15 11:12:33 -05:00
James Grugett
4e1fae5b5f Require a whole percentage for limitProb in back end 2022-08-14 20:51:10 -05:00
Sinclair Chen
facb19a347
fix dependency peer-dep warnings, mostly (#752) 2022-08-12 17:49:08 -07:00
Marshall Polaris
3cb28cdecb
Teach AuthContext to manage the private user doc (#738)
* Return both user and privateUser from `createuser`

* Make `useStateCheckEquality` more flexible

* Make `AuthContext` track the private user doc

* Change `usePrivateUser` hook to use the auth context data

* Pass both user and private user through SSR to auth context

* Fix bug in create user flow
2022-08-12 13:41:00 -07:00
Sinclair Chen
df858f916b
Migrate daisy tooltips to our own to fix cutoffs (#748)
* Make all tooltips use our component

* Stop mobile tooltip crop (daisy -> floating-ui)

* Show tooltip on tap for touch devices

Except tooltips on buttons

* migrate another daisy tooltip to ours

* Prevent hidden tooltip from covering click/hover
2022-08-12 12:04:23 -07:00
mantikoros
d2b634c775 template email tracking 2022-08-12 11:33:02 -05:00
James Grugett
3f6ca6c8ed Make Manifold account able to resolve markets 2022-08-11 00:38:15 -05:00
Marshall Polaris
8c537537a1
Add cache headers to avatars (#737)
* Set cache headers on newly uploaded avatars

* Go fix up all the old avatars to have cache headers
2022-08-10 11:03:55 -07:00
Sinclair Chen
5892ccee97
Rich text in comments, fixed (#719)
* Revert "Revert "Switch comments/chat to rich text editor (#703)""

This reverts commit 33906adfe4.

* Fix typing after being weird on Android

Issue: character from mention gets deleted. Most weird on Swiftkey:
mention gets duplicated instead of deleting.

See https://github.com/ProseMirror/prosemirror/issues/565
https://bugs.chromium.org/p/chromium/issues/detail?id=612446

The keyboard still closes unexpectedly when you delete :(

* On reply, put space instead of \n after mention

* Remove image upload from placeholder text

- Redundant with image upload button
- Too long on mobile

* fix dependency
2022-08-06 13:39:52 -07:00
Marshall Polaris
d43b9e1836
Vercel auth phase 2 (#714)
* Add cloud function to get custom token from API auth

* Use custom token to authenticate Firebase SDK on server

* Make sure getcustomtoken cloud function is fast

* Make server auth code maximally robust

* Refactor cookie code, make set and delete more flexible
2022-08-05 20:49:29 -07:00
Ian Philips
d90901b4e3 Check creator balance again upon acceptance 2022-08-05 05:03:47 -06:00
James Grugett
33906adfe4 Revert "Switch comments/chat to rich text editor (#703)"
This reverts commit f52da72115.
2022-08-04 16:49:59 -07:00
Sinclair Chen
f52da72115
Switch comments/chat to rich text editor (#703)
* Switch comments/chat to rich text editor

* Remove TruncatedComment

* Re-add submit on enter

* Insert at mention on reply

* Update editor style for send button

* only submit on enter in chat

* code review: refactor

* use more specific type for upload

* fix ESlint and errors from merge

* fix trigger on every render eslint warning

* Notify people mentioned in comment

* fix type errors
2022-08-04 16:34:04 -07:00
Sinclair Chen
edae709f5f
Notify mentioned users on market publish (#683)
* Add function to parse at mentions

* Notify mentioned users on market create

- refactor createNotification to accept list of recipients' ids
2022-08-04 15:35:55 -07:00
Ian Philips
798253f887
Challenge Bets (#679)
* Challenge bets

* Store avatar url

* Fix before and after probs

* Check balance before creation

* Calculate winning shares

* pretty

* Change winning value

* Set shares to equal each other

* Fix share challenge link

* pretty

* remove lib refs

* Probability of bet is set to market

* Remove peer pill

* Cleanup

* Button on contract page

* don't show challenge if not binary or if resolved

* challenge button (WIP)

* fix accept challenge: don't change pool/probability

* Opengraph preview [WIP]

* elim lib

* Edit og card props

* Change challenge text

* New card gen attempt

* Get challenge on server

* challenge button styling

* Use env domain

* Remove other window ref

* Use challenge creator as avatar

* Remove user name

* Remove s from property, replace prob with outcome

* challenge form

* share text

* Add in challenge parts to template and url

* Challenge url params optional

* Add challenge params to parse request

* Parse please

* Don't remove prob

* Challenge card styling

* Challenge card styling

* Challenge card styling

* Challenge card styling

* Challenge card styling

* Challenge card styling

* Challenge card styling

* Challenge card styling

* Add to readme about how to dev og-image

* Add emojis

* button: gradient background, 2xl size

* beautify accept bet screen

* update question button

* Add separate challenge template

* Accepted challenge sharing card, fix accept bet call

* accept challenge button

* challenge winner page

* create challenge screen

* Your outcome/cost=> acceptorOutcome/cost

* New create challenge panel

* Fix main merge

* Add challenge slug to bet and filter by it

* Center title

* Add helper text

* Add FAQ section

* Lint

* Columnize the user areas in preview link too

* Absolutely position

* Spacing

* Orientation

* Restyle challenges list, cache contract name

* Make copying easy on mobile

* Link spacing

* Fix spacing

* qr codes!

* put your challenges first

* eslint

* Changes to contract buttons and create challenge modal

* Change titles around for current bet

* Add back in contract title after winning

* Cleanup

* Add challenge enabled flag

* Spacing of switch button

* Put sharing qr code  in modal

Co-authored-by: mantikoros <sgrugett@gmail.com>
2022-08-04 15:27:02 -06:00
SirSaltyy
2d3ca47b52
500 mana email (#687)
* Create 500-mana.html

* Update 500-mana.html

Fixed typos and links not working

* Added "create a good market" guide

added page creating-market.html
For Stephen to set up condition (email 3 days after signing up)

* Update 500-mana.html

updated 500 Mana email (still need to make changes to create market guide)

* email changes

* sendOneWeekBonusEmail logic

* add dayjs as dependency

* don't use mailgun scheduling

Co-authored-by: mantikoros <sgrugett@gmail.com>
2022-08-04 13:03:02 -05:00
Marshall Polaris
f8a74aa438
Allow admins to resolve any market (#711) 2022-08-02 15:34:20 -07:00
Keri Warr
cfeb50826c
Add endpoint for reading currently authenticated user (#710) 2022-08-02 00:06:23 -07:00
Marshall Polaris
6901507461
Allow unspecfied outcome as input to sellshares (#706)
* Allow unspecfied outcome as input to `sellshares`

* Fix small details
2022-08-01 23:53:12 -07:00
Ian Philips
0b06ded5e5
Groups contracts (#709)
* Update group links in trigger and api

* Remove extra call during creation

* Remove grouplinks on frontend

* Deserialize

* Consolidate logic

* Move function locally
2022-08-01 21:15:09 -06:00
Marshall Polaris
b4e8c5d602
Backfill missing group IDs (#708) 2022-08-01 16:40:04 -06:00
ingawei
ae2e7dfe30
noobify welcome demo (#699)
* noobify welcome
* also beginning to add greyscale color scheme
2022-07-30 02:50:03 -05:00
mantikoros
1aaae93113
Multiple choice markets (#698)
* multipe choice answers

* create multiple choice cloud function

* multi choice market page

* show outcome '0'

* stats: multi choice type

* update place bet

* answer doc id = outcome

* update resolve market

* prettier

* fix

* fix resolution
2022-07-27 21:40:33 -05:00
Ian Philips
013ff1d941 Show api error on create contract 2022-07-26 16:44:51 -07:00
Marshall Polaris
b506e96548
Implement "sell all shares" functionality in sellshares and expose API (#696)
* Change `sellshares` to be able to sell all shares

* Sell all shares properly on bet panel UI

* Add API route for selling shares, document
2022-07-26 12:47:19 -07:00
mantikoros
ec0e25e5ed create user: remove ip check 2022-07-25 18:25:23 -07:00
Marshall Polaris
312b244e2a
Small backend cleanups (#643)
* Reuse DAY_MS in update-metrics job

* More concise transaction in cancelbet

* Remove some meaningless awaits

* Do less work in onCreateLiquidityProvision

* Do less work in onCreateAnswer
2022-07-24 00:45:45 -07:00