Commit Graph

833 Commits

Author SHA1 Message Date
rleed 247744a83c
Add a date selector to the search function (#494)
* add date picker

* lint

* add date picker

* lint

* refine

* fix/finish the date picker UI part

* finish query parameter passing & incremental cleanup

* fix/finish the date picker UI part

* finish query parameter passing & incremental cleanup

* fix bad merge

* fix linting errors

* wrap for mobile

* add date picker

* lint

* add date picker

* lint

* refine

* fix/finish the date picker UI part

* finish query parameter passing & incremental cleanup

* fix/finish the date picker UI part

* finish query parameter passing & incremental cleanup

* fix bad merge

* fix linting errors

* wrap for mobile

* merge glitch?

* enhance a little

---------

Co-authored-by: rleed <rleed1@pm.me>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-10-04 14:44:06 -05:00
Austin Kelsay b3aee502a0
Crosspost discussion items to nostr (#522)
* Crossposting discussion function, crossposting setting migration

* Passing in id, adding relays to test

* Adding checkbox setting for crossposting enabled

* Adding paramaterized event fields to crosspostDiscussion, successfully crossposting discussions

* Cleaning up for rebase

* Removing nostrRelays

* Retry crosspost toast

* Adding nostrCrossposting to settings, fixing migration

* Full flow is working with error surfacing, retries, and skips for a retry

* Updates to error handling/retries for crossposting, fixing settings for crossposting

* Allowing recursive retries for crossposting to specific relays

* Fixing / syncing crossposting settings, cleaning up and seperating out nostr functions

* Cleaning up

* Running linter

* make nostr crossposter a hook

---------

Co-authored-by: Austin <austin@pop-os.localdomain>
Co-authored-by: plebdev <plebdev@plebdevs-MacBook-Pro.local>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-10-04 13:47:09 -05:00
SatsAllDay f6141a6965
Quote reply support on text-based posts and comments (#526)
* Quote reply support on text-based posts and comments

* Clean up the `onQuoteReply` prop usage

* Refactor to use `useImperativeHandle` for Reply

* quote selected text if any, otherwise quote whole item

* Only quote selected text if it's from the item we're replying to, not just any selected text

* add trailing newline to copied text

* onPointerDown for mobile, quote+reply quotes text

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-10-03 20:12:12 -05:00
SatsAllDay 362f95add9
LUD-18 Wallet implementation (#531)
* LUD-18 Wallet implementation

Query the lightning address provider client-side to learn of capabilities

Conditionally render LUD-12 and LUD-18 fields based on what the remote
server says is supported

Allow identifier, name, and email to be sent from the SN side during the withdrawal flow. Auth seems too complicated for our use case, and idk about pubkey?

* Clear inputs if the new ln addr provier doesn't support those fields

* various ux improvements

* dynamic client-side validation for required payer data

* don't re-init form state on error

* correct min and max amount values

* only send applicable data to graphql api based on payerdata schema

* input type for numeric values (amount, max fee)

* update step for amount and max fee

* Fix identifier optional and field blur

* reuse more code

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-10-03 18:22:56 -05:00
SatsAllDay 3acaee377b
LUD-18 Service Support (#518)
* first pass of LUD-18 support

* Various LUD-18 updates

* don't cache the well-known response, since it includes randomly generated single use values

* validate k1 from well-known response to pay URL

* only keep k1's for 10 minutes if they go unused

* fix validation logic to make auth object optional

* Various LUD18 updates

* move k1 cache to database

* store payer data in invoice db table

* show payer data in invoices on satistics page

* show comments and payer data on invoice page

* Show lud18 data in invoice notification

* PayerData component for easier display of info in invoice, notification, wallet history

* `payerData` -> `invoicePayerData` in fact schema

* Merge prisma migrations

* lint fixes

* worker job to clear out unused lnurlp requests after 30 minutes

* More linting

* Move migration to older

* WIP review

* enhance lud-18

* refine notification ui

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-10-03 14:35:53 -05:00
ekzyis 1e417ba670
Image refactor refactor (#541)
* Remove outdated comments about srcSet value

We no longer distinguish between `undefined` and `null` for `srcSet`.

* Fix misleading URL shown

* Update/fix comments in <ImageOriginal>

* Simplify condition when to show image

I think this is not required since `showImage` will always stay false if tab !== 'preview' or me?.clickToLoadImg are true.

* Rename to imgproxyOnly

* Add info to imgproxyOnly setting

* Fix text of markdown links not used on imgproxy errors

* Fix rendering markdown links with text as images

---------

Co-authored-by: ekzyis <ek@stacker.news>
2023-10-03 13:05:04 -05:00
SatsAllDay 65fa3cf966
fix singular/plural for invoice deposit notification (#527) 2023-10-02 19:19:20 -05:00
keyan 62b53e1b3e make zoomable image fallback to link, fix styling, refine text component, search highlighting without remark-directive 2023-10-02 19:07:05 -05:00
ekzyis 1e23f787bd
Fix image preview not ignoring privacy setting (#536)
* Fix images not ignoring privacy setting during preview

* Fix image detection not ignoring privacy setting during preview

---------

Co-authored-by: ekzyis <ek@stacker.news>
2023-10-02 07:28:39 -05:00
keyan 1ee3d6aa0a small bug fixes 2023-10-01 19:29:07 -05:00
ekzyis b2b38d8924
Images v2 (#513) 2023-10-01 18:03:52 -05:00
keyan 523b6674b8 make sub changing more intuitive 2023-09-29 14:20:07 -05:00
keyan 08e4093877 increase poll choice length to 40 chars 2023-09-28 16:52:11 -05:00
keyan 4bd489a36a mutes 2023-09-28 15:02:25 -05:00
keyan b6cb895871 opg => fwd 2023-09-27 13:20:16 -05:00
keyan cfb8fa7014 remove expiration when invoice is confirmed 2023-09-27 12:19:56 -05:00
keyan cf5b296a9f add prism logo 2023-09-26 16:44:57 -05:00
keyan f27cd2d6dd protect against comment root not having forwards 2023-09-26 15:15:31 -05:00
keyan 370e3c1c48 raise boost minimum to 25k, enhance editing boost, JIT fund editing costs 2023-09-25 19:54:35 -05:00
keyan 374cc26224 indicate commenter is part of forwarded group 2023-09-25 16:47:24 -05:00
SatsAllDay 8017355924
Lightning strike on donation, if enabled. Else success toast (#517)
* Lightning strike on donation, if enabled. Else success toast

* remove extra toast from merge

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-09-24 15:10:44 -05:00
SatsAllDay d60a589bc0
Implementing LUD-12 comments on payRequest in LNURLP Lightning Address flow (sending and receiving) (#498)
* Prototype implementing LUD-12 comments on payRequest in LNURLP Lightning Address flow

* Support sending comment when withdrawing to ln addr (LUD-12)

* Prevent `initialError` from being toasted informs multiple times

* delete the old create_invoice function

* improve lightning addr withdrawal styling

* allow lnaddr comment to show up in notifications

* enhance satistics

---------

Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-09-23 20:14:49 -05:00
keyan 14d2573dd2 fix non-unique bountyPaidTo display 2023-09-18 19:15:02 -05:00
keyan fb3837ea0a use number formatting more places 2023-09-18 18:09:08 -05:00
ekzyis 3a7c3f7af2
Add setting to send diagnostics back to SN (#463)
* Add diagnostics settings & endpoint

Stackers can now help us to identify and fix bugs by enabling diagnostics.

This will send anonymized data to us.

For now, this is only used to send events around push notifications.

* Send diagnostics to slack

* Detect OS

* Diagnostics data is only pseudonymous, not anonymous

It's only pseudonymous since with additional knowledge (which stacker uses which fancy name), we could trace the events back to individual stackers.

Data is only anonymous if this is not possible - it must be irreversible.

* Check if window.navigator is defined

* Use Slack SDK

* Catch errors of slack requests

---------

Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-09-18 18:00:16 -05:00
SatsAllDay 786c185464
Introduce format option on `numWithUnits` fn, consumed by bounty listing (#496) 2023-09-18 17:49:13 -05:00
keyan ccb1c07c3f use code icon for contibutors 2023-09-18 14:17:22 -05:00
SatsAllDay bc2363dfab
Verified contributors (#474)
* `isContributor`, `hideIsContributor` user fields and basic UI decoration on profile page

* Update verified contributor decoration on profile page

* Add contributors instructions

* update setting label

* Remove `isContributor` from DB, load contributors from file into memory

* fix merge error

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-09-18 13:57:02 -05:00
SatsAllDay 8ab58fff87
Proposal: User Subscriptions: separate posts and comments (#470)
* Subscribe to user posts and comments independently

* Track when comments and posts subscriptions are set to filter out old items

* Only send push notification to subscribed user if posts/comments enabled

* Remove `posts` and `comments` boolean fields on UserSub, rely solely on timestamps
2023-09-18 13:20:02 -05:00
keyan cee00af83c fix job image upload 2023-09-14 10:35:13 -05:00
keyan 7d170a654f variable downzaps 2023-09-13 21:08:03 -05:00
keyan 4b543ae733 prevent wallet balance overflow 2023-09-12 20:21:59 -05:00
keyan bd07fc7a25 fix height of foward percent on validation err 2023-09-12 17:04:49 -05:00
keyan 52d938a22a remove block from blockheight 2023-09-12 16:36:26 -05:00
keyan 79b58600e9 fix styling of forwards 2023-09-12 15:56:03 -05:00
keyan c3498be5ba signup => sign up in welcome banner 2023-09-12 14:51:55 -05:00
keyan 490edd6833 prevent horizontal layout shift when balance is hidden 2023-09-12 14:50:06 -05:00
keyan b1d6bf058e make balance hiding work on mobile using pointer events 2023-09-12 14:37:13 -05:00
ekzyis 6df654b208
Hide wallet balance (#481)
* Hide wallet balance on long press

* Use setting to hide wallet balance

* Fix layout shift on hover

* Fix SSR warning about useLayoutEffect

See https://reactjs.org/link/uselayouteffect-ssr

* Also hide balance in wallet

---------

Co-authored-by: ekzyis <ek@stacker.news>
2023-09-12 12:19:26 -05:00
SatsAllDay 1a6dc879a2
Dependency inject `me` into post validation schemas to enforce no forwarding posts to self (#485)
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-09-12 11:56:59 -05:00
SatsAllDay 16a6f93708
Add block height to price carousel (#484)
* Add block height to price carousel

source block height from mempool.space API
https://mempool.space/docs/api/rest#get-block-tip-height

* Add block height to SSR, clean up fragment query

* Cache block height for 1 minute, not 30 seconds

use `numWithUnits` for block height label

* Replace mempool.space API with LND API call

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-09-12 10:56:02 -05:00
SatsAllDay 94fbabcdf9
Notifications for when you are forwarded sats from a post (#467)
* Notifications for when you are forwarded sats from a post

Support notifications when a post for which you are forwarded gets zapped

This is controlled by a new boolean flag in user settings

* Send push notifications to forwarded users when they get forwarded sats

* Add `Promise.allSettled` per PR feedback

* Remove `FEE` act type when building forwarded zaps notifications

Don't include `FEE` actions, only `TIP` actions to avoid "0 sats forwarded" notifications

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-09-12 10:31:46 -05:00
keyan 9064224fd3 allow input character overflow for editting 2023-09-11 19:59:36 -05:00
SatsAllDay 77daa458cf
Visual Character counter for post titles, poll options (#466)
* Indicate how many chars remain for title field and poll options

Live counter update to help authors know how many more chars they have
to use in their post titles, and also poll options

* Use InputInner for consistency

* Refactor to reuse title hint across all forms

* Character(s)

* Move maxLength hint impl to InputInner, per PR feedback

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-09-11 19:20:44 -05:00
rleed 1969d82741
move search bar to top of page (#433)
* move search bar to top of page

* move select inputs below search bar

* reduce complexity

* default search to zaprank

* votes => zaprank

---------

Co-authored-by: rleed <rleed1@pm.me>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-09-11 18:11:47 -05:00
rleed 2ba969ebab
Add new visitor welcome banner (#418)
* add new visitor welcome banner

* show dismissible banner on first-time login

* add mutation to hide welcome banner

* Update components/banners.js

Co-authored-by: ekzyis <27162016+ekzyis@users.noreply.github.com>

* fix error handling

* simplifications and other review suggestions

* cleanup

* restore selective display logic

* remove unnecessary query arguments

* cleanup a bit more

* don't show welcome banner to existing stackers

---------

Co-authored-by: rleed <rleed1@pm.me>
Co-authored-by: ekzyis <27162016+ekzyis@users.noreply.github.com>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-09-11 16:29:45 -05:00
ekzyis 0c7d432056
Fix replying to wrong comment (#478)
Co-authored-by: ekzyis <ek@stacker.news>
2023-09-11 14:58:11 -05:00
SatsAllDay 9d05a5d09f
toast border color based on variant (#469) 2023-09-11 14:57:41 -05:00
keyan 29d17dce21 fix invoicable modal close race condition 2023-08-31 12:26:42 -05:00
keyan ed722fffdd remove reminder that you can overpay an invoice 2023-08-31 10:37:58 -05:00
keyan 3e0167a4aa fix merge typo 2023-08-31 10:20:01 -05:00
ekzyis 6c203a4476
Use callback to clear local storage on success (#462)
Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-08-31 10:15:52 -05:00
ekzyis 803acd1fc4
Replace FundError with InvoiceModal (#455)
* invoices are no longer deleted to prevent double-spends but marked as confirmed.
  therefore, during checkInvoice, we also check if the invoice is already confirmed.
* instead of showing FundError (with "fund wallet" and "pay invoice" as options), we now always immediately show an invoice
* since flagging, paying bounties and poll voting used FundError but only allowed spending from balance, they now also support paying per invoice

Co-authored-by: ekzyis <ek@stacker.news>
2023-08-31 10:10:24 -05:00
ekzyis ac45fdc234
Use HODL invoices (#432)
* Use HODL invoices

* Fix expiry check comparing string with Date

* Fix unconfirmed user balance for HODL invoices

This is done by syncing the data from LND to the Invoice table.

If the columns is_held and msatsReceived are set, the frontend is told that we're ready to execute the action.

We then update the user balance in the same tx as the action.

We need to still keep checking the invoice for expiration though.

* Fix worker acting upon deleted invoices

* Prevent usage of invoice after expiration

* Use onComplete from <Countdown> to show expired status

* Remove unused lnd argument

* Fix item destructuring from query

* Fix balance added to every stacker

* Fix hmac required

* Fix invoices not used when logged in

* refactor: move invoiceable code into form

* renamed invoiceHash, invoiceHmac to hash, hmac since it's less verbose all over the place
* form now supports `invoiceable` in its props
* form then wraps `onSubmit` with `useInvoiceable` and passes optional invoice options

* Show expired if expired and canceled

* Also use useCallback for zapping

* Always expire modal invoices after 3m

* little styling thing

---------

Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-08-30 21:48:49 -05:00
SatsAllDay c6dfd1e39c
Fix toast weirdness on iOS scrolling (#461)
* Fix toast weirdness on iOS scrolling

* Remove unnecessary css hacks
2023-08-30 21:16:47 -05:00
SatsAllDay 1872d6a7ad
Update twitter url regexs to match x.com or twitter.com (#454)
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-08-30 20:13:43 -05:00
keyan b3eb1fbd96 fix reward range notification link 2023-08-30 10:22:25 -05:00
keyan faf71f744c handle some rewards corner cases 2023-08-30 10:00:47 -05:00
keyan b6c822f40e allow viewing reward ranges 2023-08-29 19:13:21 -05:00
keyan a40eb642a0 rewards only go to top posts/comments 2023-08-29 16:05:09 -05:00
SatsAllDay 0d4a225442
Subscribe to a user (#443)
* First pass of user subscriptions

* add new db model to track subscriptions
* update user typedef and api resolver for subscription state
* add subscribe action to user profile page
* add mutation to subscribe to a user

* Update notifications queries, hasNewNotes queries for FollowActivity note type

* Only show items that have been created since subscribing to the user

* Send push notifications to user subscribers for posts and comments

* Rename item dropdown to action dropdown and re-use for item info and user actions

* Don't allow self-follows

* Add index on followee for faster lookups

* Don't show subscribe action if not logged in

* small style enhance

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-08-28 20:27:56 -05:00
SatsAllDay b24b06eeee
Minor tweaks to the page footer (#452)
1. Use an ActionTooltip to explain what the light/dark mode and lightning buttons are for
2. Open the current commit github link in a new tab
2023-08-28 19:35:25 -05:00
keyan e77bc819bb fix forward percentage width on mobile 2023-08-28 14:31:28 -05:00
keyan a0af954d60 add how many times bounty has been paid 2023-08-28 14:14:14 -05:00
keyan 169c762a1f rm commas in forward lists 2023-08-28 09:59:01 -05:00
keyan f23e05f671 foss contrib in footer 2023-08-28 09:46:56 -05:00
keyan 88da287a87 hide zap bolt for forward users (#445) 2023-08-28 09:40:29 -05:00
keyan f1ad321857 fix forward notification styling 2023-08-28 08:22:51 -05:00
keyan 3e4c189a1d fix alert close styling and zap popover styling 2023-08-25 19:03:02 -05:00
keyan 46f235d60c add removed snl banner 2023-08-25 18:43:50 -05:00
SatsAllDay 0ee056b2a1
Toast (#431)
* Prototype of toast system

* More toast adoption

* share
* flag
* bookmark
* subscribe
* delete

* More toast usage:

* forms
* settings save

* Log error during flag failure

* Incorporate PR feedback:

1. return `toaster` from `useToast` hook, with simplified `success` and `danger` methods

2. remove toast header, move close button to body

3. change how toast ids are generated to use a global incrementing int

4. update toast messages

* PR feedback:

* reduce width of toast on narrow screens
* dynamic delete success toast message based on deleted type
* add toasts to auth methods deletion operations

* Dismiss all toasts upon page navigation

* refine style and use delay prop

* more styling

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-08-25 18:21:51 -05:00
keyan a847b16b2c make item creation easier 2023-08-25 13:42:55 -05:00
SatsAllDay 137e99cf7f
Add meta sub to rss popover in footer (#440)
move nostr sub up to top row for 3 and 3 instead of 2 and 4
2023-08-23 20:29:08 -05:00
SatsAllDay 3da395a792
multiple forwards on a post (#403)
* multiple forwards on a post

first phase of the multi-forward support

* update the graphql mutation for discussion posts to accept and validate multiple forwards

* update the discussion form to allow multiple forwards in the UI

* start working on db schema changes

* uncomment db schema, add migration to create the new model, and update create_item, update_item
stored procedures

* Propagate updates from discussion to poll, link, and bounty forms

Update the create, update poll sql functions for multi forward support

* Update gql, typedefs, and resolver to return forwarded users in items responses

* UI changes to show multiple forward recipients, and conditional upvote logic changes

* Update notification text to reflect multiple forwards upon vote action

* Disallow duplicate stacker entries

* reduce duplication in populating adv-post-form initial values

* Update item_act sql function to implement multi-way forwarding

* Update referral functions to scale referral bonuses for forwarded users

* Update notification text to reflect non-100% forwarded sats cases

* Update wallet history sql queries to accommodate multi-forward use cases

* Block zaps for posts you are forwarded zaps at the API layer, in addition
to in the UI

* Delete fwdUserId column from Item table as part of migration

* Fix how we calculate stacked sats after partial forwards in wallet history

* Exclude entries from wallet history that are 0 stacked sats from posts with 100% forwarded to other users

* Fix wallet history query for forwarded stacked sats to be scaled by the fwd pct

* Reduce duplication in adv post form, and do some style tweaks for better layout

* Use MAX_FORWARDS constants

* Address various PR feedback

* first enhancement pass

* enhancement pass too

---------

Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-08-23 17:44:17 -05:00
ekzyis 0ea4f9bc27
Fix click to load in preview (#427)
* Rename confusing variable name

* Use nullish coalescing operator

* Fix click to load in preview

---------

Co-authored-by: ekzyis <ek@stacker.news>
2023-08-23 15:30:38 -05:00
ekzyis 427fc9aeec
Fix youtube player x-overflow (#426)
Co-authored-by: ekzyis <ek@stacker.news>
2023-08-23 15:29:09 -05:00
rleed 799ec987b4
Forward sats to user: text trimming and menu click-out UX improvements (#397)
Co-authored-by: rleed <rleed1@pm.me>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-08-19 18:30:41 -05:00
SatsAllDay b9a8ec84bb
Remove OP badge for comments by anon on posts by anon (#422)
Add a post to the seed file from anon, with a comment by anon for easier testing
2023-08-19 16:03:07 -05:00
keyan df6575d701 remove slashtags completely 2023-08-17 13:40:21 -05:00
keyan c6cc7510c7 remove sats info from ads 2023-08-16 17:58:43 -05:00
keyan 7235a4a54f restyle ad to be clearer 2023-08-16 17:53:51 -05:00
keyan 68f298fc21 add simple badge to ad 2023-08-16 14:39:01 -05:00
ekzyis 670c567bff
Configure imgproxy timeouts + add click to load on imgproxy errors (#404)
* Configure imgproxy timeouts

* Use click to load on imgproxy errors

* Add setting for click to load

---------

Co-authored-by: ekzyis <ek@stacker.news>
2023-08-15 12:55:16 -05:00
rleed 45bad1219e
Fix link to profile matching current URL, not profile (#395)
* break out profile menu and remove top-level href

* group the bio hint with the menu

* rebase/merge

---------

Co-authored-by: rleed <rleed1@pm.me>
2023-08-15 12:54:24 -05:00
keyan e4831e65d5 show sources and history of rewards 2023-08-15 12:41:51 -05:00
keyan 679f766f07 add average comments per post to items analytics 2023-08-14 15:36:54 -05:00
keyan 03f0329984 fix image uploading/edit 2023-08-13 14:12:18 -05:00
ekzyis f0bc1baed2 Save payment tokens in localStorage 2023-08-12 04:18:32 +02:00
ekzyis 4d725272e3 Fix cost not set after form reset 2023-08-12 03:12:03 +02:00
keyan 5b821906cf use builtin copy input label 2023-08-11 18:43:45 -05:00
keyan 705e21a72c add comma to anon info 2023-08-11 18:19:35 -05:00
keyan 86239a235d make invoice expiration times have saner defaults 2023-08-11 18:10:46 -05:00
keyan abb9ca5524 anon info typo 2023-08-11 17:54:26 -05:00
keyan a5eb7b5443 invoice check backoff 2023-08-11 17:54:26 -05:00
ekzyis 9e4f9aa558 Catch invoice errors in fund error modal 2023-08-12 00:35:24 +02:00
keyan 39db6e096d restyle fund error modal 2023-08-11 17:05:21 -05:00
keyan 63dd5d4d09 fix qr layout shift 2023-08-11 17:05:21 -05:00
ekzyis 73aa0d2d44 Fix localStorage cleared because error were swallowed 2023-08-11 23:36:53 +02:00
keyan 38fddcf283 concat hash and hmac and call it a token 2023-08-11 14:22:18 -05:00
keyan b2508b738a make anon hat appear on profile 2023-08-11 14:12:18 -05:00
keyan 9c6ecf9526 correct overlay zap text for anon 2023-08-11 12:43:18 -05:00
keyan e4c2d113ef remove redundant meTotalSats 2023-08-11 12:41:02 -05:00
ekzyis 41f46cf41e Fix empty invoice creation attempts
I stumbled across this while checking if anons can edit their items.

I monkey patched the code to make it possible (so they can see the 'edit' button) and tried to edit an item but I got this error:

  Variable "$amount" of required type "Int!" was not provided.

I fixed this even though this function should never be called without an amount anyway. It will return a sane error in that case now.
2023-08-11 05:30:22 +02:00
ekzyis 28b4588a12 Fix [object Object] as error message
Any errors thrown here are already objects of shape { message: string }
2023-08-11 05:30:06 +02:00
keyan d92701c56f don't abbreviate 2023-08-10 19:58:33 -05:00
keyan ea9c405dfa add sat amounts to invoices 2023-08-10 18:33:57 -05:00
keyan 53a6c9489f fix forgotten find and replace 2023-08-10 17:40:50 -05:00
keyan 26762efcea add generic date pivot helper 2023-08-10 17:36:49 -05:00
keyan 46274fba4f give anon an icon 2023-08-10 17:36:49 -05:00
ekzyis 2fbf1e4cc3 Keep track of modal stack 2023-08-11 00:35:43 +02:00
ekzyis 49736e8d3c Always show repeat and contacts on action error 2023-08-10 23:04:06 +02:00
keyan 081c5fef0b make anon posting less hidden, add anon info button explainer 2023-08-10 14:41:56 -05:00
Keyan cbfd6998a6
Merge branch 'master' into 266-zaps-without-account 2023-08-10 12:40:30 -05:00
ekzyis bb2212d51e Add invoice HMAC
This prevents entities which know the invoice hash (like all LN nodes on the payment path) from using the invoice hash on SN.

Only the user which created the invoice knows the HMAC and thus can use the invoice hash.
2023-08-10 07:10:07 +02:00
ekzyis 4fe1d416de Fix onConfirmation called at every render 2023-08-10 04:13:09 +02:00
ekzyis 318088179a Rename to useInvoiceable 2023-08-10 03:34:38 +02:00
ekzyis 38dbbd5a4f Fix comment copy-paste error 2023-08-10 03:34:38 +02:00
ekzyis 118f591d04 Merge branch 'master' into 266-zaps-without-account 2023-08-10 03:34:38 +02:00
SatsAllDay d5f7855adf
Debounce API requests on edit nym by 500ms (#387)
Support an optional debounce prop on Input component

If provided, the debounce is applied to the validation of the containing form,
imperatively invoking form validation after debounce is finalized

Also required introducing the `validateOnChange` prop on `Form` which gets passed to `Formik`, and defaults to true, just as it does in `Formik`.

Imperatively invoking form validation seemed to be the only way to debounce the validation call through formik.
2023-08-09 17:06:22 -05:00
keyan b92f63ca88 fix remaining misuses of plural units 2023-08-08 17:15:30 -05:00
keyan da78d244ef handle when navigator controller isn't present 2023-08-08 16:55:53 -05:00
keyan 3cfeede46a handle all singular units appropriately 2023-08-08 16:47:27 -05:00
SatsAllDay 9941bc6519
render "reply" or "replies", "comment" or "comments" depending on the count (singular or plural) (#382)
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-08-08 16:07:00 -05:00
SatsAllDay 6e05cd38f9
Singular/Plural "Sats" labels (#380)
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-08-08 16:04:06 -05:00
ekzyis 67a0de3ea5
Notifications with nostr info (#368)
* Show zap message and pubkey in notifications

+ show zap request event in invoice view

* enhance ui

---------

Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-08-08 13:19:31 -05:00
Keyan 76b4156ccb
Merge branch 'master' into 266-zaps-without-account 2023-08-08 09:42:21 -05:00
ekzyis e3c60d1ef8
Sync push subscriptions on every page load (#370)
Most browsers don't support the pushsubscriptionchange event.

We workaround this by saving the current push subscription in IndexedDB so we can check during every page load if the push subscription changed.

If that is the case, we manually sync the push subscription with the server.

However, this solution is not perfect as mentioned in https://medium.com/@madridserginho/how-to-handle-webpush-api-pushsubscriptionchange-event-in-modern-browsers-6e47840d756f which was used for reference:

> This solution is not perfect, the user could lose some push notifications if he doesn’t open the webapp for a long time.

Co-authored-by: ekzyis <ek@stacker.news>
2023-08-07 20:03:34 -05:00
ekzyis 7369bd819d
Add nostr login (#367)
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-08-07 19:50:01 -05:00
keyan a0974e4d6c Merge branch 'master' into 266-zaps-without-account 2023-08-07 16:48:52 -05:00
keyan a3b668587d fix top cowboys 2023-08-07 16:26:15 -05:00
Keyan 3d0bb4b32c
Merge branch 'master' into 266-zaps-without-account 2023-08-07 15:10:20 -05:00
keyan 0867f3ff1c only outline eldest new comment ... unset on touch 2023-08-07 09:29:47 -05:00
keyan d661c70f16 more noticable new comment indicator 2023-08-06 14:31:24 -05:00
keyan 1efc17fcc2 subtle highlight of new comments 2023-08-06 14:18:40 -05:00
keyan ea1e31c6ee prevent horizontal layout shift on new comments 2023-08-06 13:21:38 -05:00
keyan ebfff4677f fix top header/stat order on back/forward nav 2023-08-06 13:13:32 -05:00
keyan 90f4d41fc8 remove list jitter by initially preferring ssr 2023-08-06 13:04:25 -05:00
keyan eeaf6e10e5 reduce rerenders in notifications 2023-08-06 10:47:58 -05:00
keyan b9fdbde520 fix back button render jitter 2023-08-05 12:56:03 -05:00
keyan d9dd4bc05b prevent scroll to comment on rerender 2023-08-05 12:13:15 -05:00
keyan aea8948c45 dark-mode needs to block block 2023-08-04 20:45:12 -05:00
keyan 8d8e2859dd fix dark mode 2023-08-04 19:21:51 -05:00
keyan 23257d8c63 fix notifications glitchiness 2023-08-04 12:08:16 -05:00
keyan 42234eae9b highlight notification on back button 2023-08-03 19:14:04 -05:00
keyan 4e41f67e87 fix notification url replacement 2023-08-03 18:04:43 -05:00
keyan 94e975033c fix fee button receipt background color 2023-08-03 15:13:07 -05:00
keyan 0ab9119739 improve notifications UX: highlight reply and distinguish new notifications 2023-08-03 14:56:59 -05:00
keyan 7596b0302a improve click to context behavior and add ssrForceFetchDelay to apollo 2023-08-03 13:13:49 -05:00
keyan b1b8f9de56 implement our own nprogress bar 2023-08-01 21:06:15 -05:00
keyan e1c51075a2 fix conditional nextFetchPolicy overriding cache-only on SSR and suppress time hydration warnings 2023-07-31 14:54:30 -05:00
keyan f91be5d70f fix form skeleton 2023-07-31 12:35:58 -05:00
keyan b42a934207 fix invites signup via lightning/slashtags 2023-07-31 09:19:53 -05:00
keyan bc5a19c6ee suppress hydration warnings when relative time is rendered 2023-07-31 09:12:56 -05:00
keyan d2216e80da conform to linter 2023-07-31 08:39:10 -05:00
ekzyis ba04e6522d Also strike on payment after short press 2023-07-30 23:45:08 +02:00
ekzyis d186e869e1 Allow pay per invoice for bounty and job posts 2023-07-30 23:45:08 +02:00
ekzyis f2f09b22c4 Fix invoice amount for comments 2023-07-30 23:45:08 +02:00
ekzyis 1cd9750be5 Fix insufficient funds error detection 2023-07-30 23:45:08 +02:00
ekzyis 773f658e00 Remove duplicate insufficient funds handling 2023-07-30 23:45:08 +02:00
ekzyis 6b4b5023f6 Keep invoice modal open if focus is lost 2023-07-30 23:45:07 +02:00
ekzyis 853a389b65 Allow pay per invoice for stackers
The modal which pops up if the stacker does not have enough sats now has two options: "fund wallet" and "pay invoice"
2023-07-30 23:45:07 +02:00
ekzyis fd8510d59f Use payment hash instead of invoice id as proof of payment
Our invoice IDs can be enumerated.
So there is a - even though very rare - chance that an attacker could find a paid invoice which is not used yet and use it for himself.
Random payment hashes prevent this.

Also, since we delete invoices after use, using database IDs as proof of payments are not suitable.
If a user tells us an invoice ID after we deleted it, we can no longer tell if the invoice was paid or not since the LN node only knows about payment hashes but nothing about the database IDs.
2023-07-30 23:45:07 +02:00
ekzyis 74893b09dd Add anon comments and posts (link, discussion, poll) 2023-07-30 23:45:07 +02:00
ekzyis 5415c6b0f6 Add anon zaps 2023-07-30 23:45:07 +02:00
keyan 42bdd40f91 show errors on settings during auth linking 2023-07-30 15:39:18 -05:00
keyan 5232b59625 upgrade to next-auth 4 (bonus: improve error pages) 2023-07-29 14:38:20 -05:00
keyan 7490e5c249 fix syntax highlighting warnings 2023-07-27 12:10:05 -05:00
keyan 7542dd6cc4 upgrade to prisma 4 2023-07-26 19:18:42 -05:00
keyan 5a4f63b1d5 fix pinned discussion spacing 2023-07-26 08:48:46 -05:00
keyan 8ea9938cb0 fix broken image text 2023-07-25 20:02:43 -05:00
keyan 8ab018af88 fix nested comment sorting 2023-07-25 19:45:35 -05:00
keyan 19835aef5f fix undefined sub on post pre-form 2023-07-25 15:41:46 -05:00
keyan 4c1ef62386 fix edit bio button location 2023-07-25 15:32:49 -05:00
keyan 98552c853c fix back button behavior on select navigation 2023-07-25 15:29:45 -05:00
keyan 4bfd021342 enhance styling 2023-07-25 13:32:48 -05:00
keyan ab2046ab0b fix issues with new linting 2023-07-25 09:14:45 -05:00
keyan dae9c64e96 more package updates 2023-07-24 19:50:55 -05:00
keyan e87610c45b update packages and reduce bundle size 2023-07-24 17:50:12 -05:00
keyan 356f7e072c 50% reduction in bundle size by being careful with big imports 2023-07-24 16:06:26 -05:00
keyan 6407455def upgrade react-bootstrap 2023-07-24 13:53:53 -05:00
keyan 59f7b6ff26 Revert "Revert "shield your eyes; massive, squashed refactor; nextjs/react/react-dom/apollo upgrades""
This reverts commit 18910fa2ed.
2023-07-23 10:08:43 -05:00
keyan 18910fa2ed Revert "shield your eyes; massive, squashed refactor; nextjs/react/react-dom/apollo upgrades"
This reverts commit d0314ab73c.
2023-07-23 09:16:12 -05:00
keyan d0314ab73c shield your eyes; massive, squashed refactor; nextjs/react/react-dom/apollo upgrades 2023-07-21 17:33:11 -05:00
keyan 253d75b438 fix item icon fix 2023-07-15 11:35:10 -05:00
keyan 3c3de2eb24 fix item icon styling 2023-07-14 11:07:03 -05:00
keyan 7a4ba715e0 memoize table of contents 2023-07-13 15:56:57 -05:00
keyan 3c711b6083 enhance image detection and proxy 2023-07-13 15:18:04 -05:00
ekzyis 0d3328e509
Show longest cowboy streak in profile (#353)
* Show longest cowboy streak in profile

* Fix image offset

* Initialize maxStreak for every user

* Use resolver instead of denormalization for maxStreak

---------

Co-authored-by: ekzyis <ek@stacker.news>
2023-07-12 19:10:29 -05:00
Jo Wo bf4b8714fe
Render images without markdown and use image proxy (#245)
* Parse image links during markdown rendering

* Use imgproxy to replace links

* Add healthcheck

See https://docs.imgproxy.net/healthcheck

* Enable WebP and animation support

* Only replace image URLs

* Replace all occurrences

* Fix creating posts with no text

* Embed image on link posts where link is image

---------

Co-authored-by: ekzyis <ek@stacker.news>
2023-07-12 19:10:01 -05:00
keyan bc9081eaab fix race condition caused by race condition fix 2023-07-11 13:33:13 -05:00
keyan efa3172f15 top stackers sorted stat to front 2023-07-10 12:59:21 -05:00
keyan 34ba823bd4 account for no funds on zap debounce 2023-07-09 13:08:56 -05:00
keyan e8aa0a4dae users? => stackers? 2023-07-09 12:53:50 -05:00
keyan 4e9138dfdc show more info on where zap rewards came from 2023-07-09 12:21:11 -05:00
keyan f33534dd36 fix rapid voting ui race condition (#213) 2023-07-09 11:15:46 -05:00
keyan e0d89a289b fix lightning animation z-index 2023-07-06 18:07:30 -05:00
keyan ec9a424bf4 reward countdown in footer 2023-07-06 12:43:51 -05:00
ekzyis 37e70f9791
Scroll to items on push notification click (#345)
* Scroll from root item in reach on notification click

Instead of going directly to the item of the notification, we now scroll from the root item which is still in reach to the comment.

This should provide more context to the user in most cases.

* Also scroll from root item in reach in /notifications

---------

Co-authored-by: ekzyis <ek@stacker.news>
2023-07-06 10:00:38 -05:00
ekzyis 57f3ad1c75
Fix darkmode in walkthrough popover (#343)
* Fix darkmode in walkthrough popover

* Fix invalid DOM property `class`

---------

Co-authored-by: ekzyis <ek@stacker.news>
2023-07-05 15:07:18 -05:00
keyan 09d7e960cc back to lightning animation 2023-07-05 09:47:44 -05:00