Commit Graph

368 Commits

Author SHA1 Message Date
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
ekzyis 07e065d4be
Fix negative maxWithdrawable (#438)
Co-authored-by: ekzyis <ek@stacker.news>
2023-08-23 15:32:42 -05:00
SatsAllDay ee3f892053
Add new user setting to hide bookmarks from other users (and anon) (#424)
* Add new setting to hide bookmarks from other users (and anon)

* Optional chaining in case user doesnt exist, and avoid duplicate sql query in some cases
2023-08-23 15:29:55 -05:00
rleed 052bf4803c
Make withdrawal options more visible (issue167a) (#423)
Co-authored-by: rleed <rleed1@pm.me>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-08-19 19:42:50 -05:00
keyan df6575d701 remove slashtags completely 2023-08-17 13:40:21 -05:00
keyan ddb69b5d9b remove slashtags temporarily 2023-08-16 19:49:00 -05:00
SatsAllDay e6ee7f73c4
Make the web manifest dynamic to incorporate preferred color scheme (#398)
Remove the static manifest file and serve it via an API route instead.

Change the background color of the PWA depending on the client hint provided data
2023-08-15 12:58:27 -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
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
keyan 9727fb4838 merge bugs fixes for anon zapping 2023-08-12 09:21:40 -05:00
ekzyis f0bc1baed2 Save payment tokens in localStorage 2023-08-12 04:18:32 +02:00
SatsAllDay 1f6e144cb2
iOS splash screen for dark-theme (#393)
Add images for each supported iOS device for a dark-theme splash screen

Conditionally use light vs dark images based on the `(prefers-color-scheme: dark)`
media query

Note: Once the PWA is installed, it appears that iOS caches the splash screen image for an
unknown period of time, so if you change your device's preferred theme after installation,
the splash screen doesn't update to reflect it. The PWA must be re-installed for
this change to take effect.
2023-08-11 19:08:24 -05:00
ekzyis b9461b7eb3
Allow zapping, posting and commenting without funds or an account (#336)
* Add anon zaps

* Add anon comments and posts (link, discussion, poll)

* 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.

* 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"

* Fix onSuccess called twice

For some reason, when calling `showModal`, `useMemo` in modal.js and the code for the modal component (here: <Invoice>) is called twice.

This leads to the `onSuccess` callback being called twice and one failing since the first one deletes the invoice.

* Keep invoice modal open if focus is lost

* Skip anon user during trust calculation

* Add error handling

* Skip 'invoice not found' errors

* Remove duplicate insufficient funds handling

* Fix insufficient funds error detection

* Fix invoice amount for comments

* Allow pay per invoice for bounty and job posts

* Also strike on payment after short press

* Fix unexpected token 'export'

* Fix eslint

* Remove unused id param

* Fix comment copy-paste error

* Rename to useInvoiceable

* Fix unexpected token 'export'

* Fix onConfirmation called at every render

* 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.

* make anon posting less hidden, add anon info button explainer

* Fix anon users can't zap other anon users

* Always show repeat and contacts on action error

* Keep track of modal stack

* give anon an icon

* add generic date pivot helper

* make anon user's invoices expire in 5 minutes

* fix forgotten find and replace

* use datePivot more places

* add sat amounts to invoices

* reduce anon invoice expiration to 3 minutes

* don't abbreviate

* Fix [object Object] as error message

Any errors thrown here are already objects of shape { message: string }

* 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.

* anon func mods, e.g. inv limits

* anon tips should be denormalized

* remove redundant meTotalSats

* correct overlay zap text for anon

* exclude anon from trust graph before algo runs

* remove balance limit on anon

* give anon a bio and remove cowboy hat/top stackers;

* make anon hat appear on profile

* concat hash and hmac and call it a token

* Fix localStorage cleared because error were swallowed

* fix qr layout shift

* restyle fund error modal

* Catch invoice errors in fund error modal

* invoice check backoff

* anon info typo

* make invoice expiration times have saner defaults

* add comma to anon info

* use builtin copy input label

---------

Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-08-11 18:50:57 -05: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
keyan 6ba1c3e8ab anon func mods, e.g. inv limits 2023-08-11 12:14:37 -05:00
keyan e668b1f7f3 use datePivot more places 2023-08-10 17:56:30 -05:00
ekzyis bd59e392b7 Remove unused id param 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
keyan b92f63ca88 fix remaining misuses of plural units 2023-08-08 17:15:30 -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
Keyan 76b4156ccb
Merge branch 'master' into 266-zaps-without-account 2023-08-08 09:42:21 -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 3d0bb4b32c
Merge branch 'master' into 266-zaps-without-account 2023-08-07 15:10:20 -05:00
keyan ffb856ae88 fix oauth signup 2023-08-07 15:05:55 -05:00
keyan 3333cc86a2 inline dark mode script 2023-08-07 12:06:58 -05:00
keyan c606510930 update pwa blacks 2023-08-06 14:26:08 -05:00
keyan eeaf6e10e5 reduce rerenders in notifications 2023-08-06 10:47:58 -05:00
keyan e4aaaac20f don't use cache for SSR 2023-08-05 14:46:29 -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 8a5cd32be6 don't use next's script tag 2023-08-03 17:49:56 -05:00
keyan 0ab9119739 improve notifications UX: highlight reply and distinguish new notifications 2023-08-03 14:56:59 -05:00
keyan b1b8f9de56 implement our own nprogress bar 2023-08-01 21:06:15 -05:00
keyan a426c8b539 fix 404 problem 2023-08-01 12:45:46 -05:00
keyan c7e2623461 increase apollo slowlog threshold 2023-07-31 16:02:50 -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 b550f80b9f make invoices/withdrawals clickable in satistics 2023-07-31 13:00:01 -05:00
keyan 10e8cb35df fix import on invites 2023-07-31 09:11:22 -05:00
keyan d2216e80da conform to linter 2023-07-31 08:39:10 -05:00
keyan c909efb7b7 update wallet code to prisma 5, handle prisma 5 errors on serialization 2023-07-31 08:31:40 -05: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 63a4a7acad fix settings hydration error 2023-07-30 14:38:50 -05:00
keyan d04dc691df provide jwt migration 2023-07-30 14:03:24 -05:00
keyan 5232b59625 upgrade to next-auth 4 (bonus: improve error pages) 2023-07-29 14:38:20 -05:00