Commit Graph

1355 Commits

Author SHA1 Message Date
ekzyis b1cdd953a0 Return last attempted invoice in canceled state 2024-11-27 23:00:27 +01:00
ekzyis 7e25e29507 Show aggregated wallet errors in QR code 2024-11-27 23:00:27 +01:00
ekzyis be4ce5daf9 Allow retries of pessimistic actions 2024-11-27 23:00:27 +01:00
ekzyis 00f9e05dd7 Ignore wallet configuration errors in QR code 2024-11-27 23:00:27 +01:00
ekzyis 974e897753 Add comment when err.newInvoice is not set 2024-11-27 23:00:27 +01:00
ekzyis 517d9a9bb9 Abort payment on unexpected errors 2024-11-27 23:00:27 +01:00
ekzyis 413f76c33a Refactor wallet error handling with inheritance 2024-11-27 23:00:27 +01:00
ekzyis 7036804c67 Fix old invoice passed to QR code 2024-11-27 23:00:27 +01:00
ekzyis 5218a03b3a sender fallbacks 2024-11-27 23:00:27 +01:00
ekzyis 35159bf7f3 Remove unused useWallet from QR code component 2024-11-27 22:54:00 +01:00
soxa 707d7bdf8b
fix: cannot add images above text (#1659)
* fix: cannot add images above text

* make sure there are always 2 newlines on either side of media

---------

Co-authored-by: k00b <k00b@stacker.news>
2024-11-27 15:31:46 -06:00
Riccardo Balbo 6630899e79
use flexbox for wallet card header and make logos more consistent (#1654)
* use flexbox for wallet card header

* make wallet logo consistent

* remove extra div

* Update styles/wallet.module.css

Co-authored-by: ekzyis <ek@stacker.news>

* Update styles/wallet.module.css

Co-authored-by: ekzyis <ek@stacker.news>

* resize wallet banner

* remove unused justify-content

* remove cardMeta

---------

Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2024-11-27 12:14:00 -06:00
Keyan 0bff478d39
direct receives and send paid action (#1650)
* direct receives and send paid action

* remove withdrawl->invoiceForward has many relationship

* fix formatMsats implicit type expectations

* ui + dropping direct payment bolt11s

* squash migrations

* fix bolt11 dropping and improve paid action wallet logging

* remove redundant sender id

* fix redirect when funding account over threshold

* better logging
2024-11-27 07:39:05 -06:00
ekzyis b0207a2906
Create useWalletStatus and useWalletSupport (#1646) 2024-11-23 20:19:22 -06:00
ekzyis f5569d7444
Only fetch logs when we need them (#1638)
* Don't fetch logs as anon

* Only fetch logs if we need them on the current page

* Wait for poll to finish with setTimeout

This makes sure that we wait for the pending poll to finish before we poll again. This prevents running multiple polls at the same time on slow connections.

I noticed we don't need to queue a new poll ourselves since a poll updates effect dependencies so we will cleanup and run the effect again anyway.

* Fix polling via useEffect abuse
2024-11-23 18:37:30 -06:00
ekzyis cb9947e4f2
refactor: Check darkmode in useWallets (#1640)
* Check darkmode in useWallets

* Check darkmode in useWalletImage
2024-11-23 17:59:59 -06:00
ekzyis 3023d8a5d3
Remove unused function usePayment (#1641) 2024-11-23 12:21:39 -06:00
ekzyis 923ddb74ca
Use invoice.cancelledAt to determine if invoice expired or was canceled by user (#1631)
* Set and resolve invoice.cancelledAt

* Don't close modal if invoice expired
2024-11-22 08:25:20 -06:00
k00b 96e5c6c51c fix #1628 2024-11-21 08:52:24 -06:00
Simone Cervino c88afc5aae
fix can't upload mp4 on safari (#1617) 2024-11-20 07:06:05 -06:00
k00b 5dac2f2ed0 fix #1566 2024-11-19 19:12:18 -06:00
k00b aa4c448999 fix account switch disconnect 2024-11-19 14:58:48 -06:00
ekzyis c2dc0be1c1
Always use custom PTR on Android (#1607) 2024-11-18 19:13:52 -06:00
k00b 5d71e57839 fix ptr interfering with layout container 2024-11-18 17:33:45 -06:00
ekzyis 570c842934
Wallet send+recv status derived from logs (#1559)
* Derive wallet status from logs

* Add send/recv icons

* Set status individually for send and recv

* Move status logic into own function

* Add LNbits, Blink, CLN, LND, phoenixd logo

* Fix wallet.status.any not using Status enum

* Fix WebLN being weird

* Use phoenixd logo with text

* Also use wallet logo on config page

* Also poll logs for wallet status

* Use logger.info for logs not relevant for wallet status

* Remove no longer used wallet badges

* Crop LND logo like other logos

* Fix all wallets show 'configure'

* Fix wallet status not respecting enabled

* Fix wallet.def.requiresConfig undefined

* Fix banner shown for WebLN

* Fix attach shown when configured

* Filter by context.status to determine wallet status

* Fix +- shown without context

* Fix missing theme support for wallet logos
2024-11-18 16:46:24 -06:00
Keyan 62cf5b9c34
Merge pull request #1603 from stackernews/fix-dark-mode-update
Fix missing useDarkMode update
2024-11-18 16:09:16 -06:00
ekzyis 120dd4122f Fix missing useDarkMode update 2024-11-18 23:01:12 +01:00
Keyan c3b7ad3fdd
Merge pull request #1599 from Soxasora/feat_pwa_pull_to_refresh
feat: PWA pull to refresh
2024-11-18 13:11:56 -06:00
k00b d2b5d23af5 add body margin on ptr 2024-11-18 13:05:51 -06:00
Soxasora a992426058 enhance: cleanup, ux/ui changes, safer approach to android's ptr 2024-11-18 15:49:54 +01:00
Soxasora 5a359feeed test: togglable Android's native PTR 2024-11-17 21:58:40 +01:00
Simone Cervino c08088bdbe
fix uploaded videos don't load on safari (#1593)
* fix uploaded videos don't load on safari

* fix safari loading video as image, min-content restored

* refinements for ssr and skip load check for images

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2024-11-17 13:38:11 -06:00
Soxasora eea121e30c feat: pull-to-refresh for PWA without native refresh 2024-11-17 20:23:26 +01:00
Lorenzo 83e72e21cc
fix: reply storage is updated with the new content on file upload (#1585)
* fix: reply storage is updated with the new content on file upload

* Revert "fix: reply storage is updated with the new content on file upload"

This reverts commit 350931fd0c7a47ffe59716722755ab294c481b71.

* chore: reworked image draft save by using events

* chore: helpers.setValue called just after setNativeValue

* chore: updated setNativeValue function to be more use-case specific
2024-11-16 17:23:07 -06:00
Lorenzo 8a2bd84f69
fix: upvote widget not rendered when comment is collapsed (#1583)
* fix: upvote widget not rendered when comment is collapsed

* fix: restored missing conditional on handleShortPress

* chore: icon horizontal space maintained even if the comment is collapsed

* chore: 'rendered' argument renamed to 'visible'

* chore: collapsed condition merged with the 'disabled' variable

* reduce unecessary code

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2024-11-16 17:04:49 -06:00
Riccardo Balbo 9c55f1ebe2
Implement deposit as receive paidAction (#1570)
* lnurlp paid action

* lnurlp has 10% sybil fee

* fix merge issue

* Update pages/settings/index.js

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>

* fix notifications

* fix destructure

* pass lud18Data to lnurlp action

* minor cleanup

* truncate invoice description to permitted length

* remove redundant targetUserId

* lnurlp paidAction -> receive paidAction

* remove redundant user query

* improve determining if peer is invoiceable

* fix inconsistent relative imports

* prevent paying self-proxied invoices and better held invoice cancellation

* make gun/horse streak zap specific

* unique withdrawal hash should apply to confirmed payments too

* prevent receive from exceeding wallet limits

* notifications

* fix notifications & enhance invoice/withdrawl page

* notification indicator, proxy receive based on threshold, refinements

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2024-11-15 18:38:14 -06:00
ekzyis 08c29b9f10
Fix missing sorting of wallet logs (#1581) 2024-11-12 19:48:21 -06:00
Keyan a44d0daf09
paid action payment methods as an array (#1584)
* introduce fee credits & allow paid actions to specify payment method priority

* fix merge issue

* express supported paid action payment methods as an array

* log force payment method skipping methods

* fix stuff

* immutable context

* immutable paidAction context and other fixes

---------

Co-authored-by: Riccardo Balbo <riccardo0blb@gmail.com>
2024-11-12 19:00:51 -06:00
ekzyis fdd34b2eb3
Fix edit countdown on deleted items (#1571)
* Clarify conditions to show edit countdown

* Fix edit countdown shown for deleted items

* refactor: Minimize canEdit state

I noticed that only anonEdit requires state because it needs to use useEffect to fetch from local storage.

The other conditions can simply be checked during render.

* refactor: Use datePivot for edit countdown
2024-11-11 09:23:08 -06:00
ekzyis 406ae81693
Fixes around account switching / authentication (#1575)
* Fix missing page reload after account switch on logout

* Fix missing key

* Explain why we set multi_auth cookies on login/signup

* Fix 500 if multi_auth cookie missing
2024-11-11 09:16:32 -06:00
ekzyis d06f4ae70d
Fix offcanvas not closed before showing logout prompt (#1561) 2024-11-09 14:00:36 -06:00
ekzyis 72e2d19433
supercharged wallet logs (#1516)
* Inject wallet logger interface

* Include method in NWC logs

* Fix wrong page total

* Poll for new logs every second

* Fix overlapping pagination

* Remove unused total

* Better logs for incoming payments

* Use _setLogs instead of wrapper

* Remove inconsistent receive log

* Remove console.log from wallet logger on server

* Fix missing 'wallet detached' log

* Fix confirm_withdrawl code

* Remove duplicate autowithdrawal log

* Add context to log

* Add more context

* Better table styling

* Move CSS for wallet logs into one file

* remove unused logNav class
* rename classes

* Align key with second column

* Fix TypeError if context empty

* Check content-type header before calling res.json()

* Fix duplicate 'failed to create invoice'

* Parse details from LND error

* Fix invalid DOM property 'colspan'

* P2P zap logs with context

* Remove unnecessary withdrawal error log

* the code assignment was broken anyway
* we already log withdrawal errors using .catch on payViaPaymentRequest

* Don't show outgoing fee to receiver to avoid confusion

* Fix typo in comment

* Log if invoice was canceled by payer

* Automatically populate context from bolt11

* Fix missing context

* Fix wrap errors not logged

* Only log cancel if client canceled

* Remove unused imports

* Log withdrawal/forward success/error in payment flow

* Fix boss not passed to checkInvoice

* Fix TypeError

* Fix database timeouts caused by logger

The logger shares the same connection pool with any currently running transaction.

This means that we enter a classic deadlock when we await logger calls: the logger call is waiting for a connection but the currently running transaction is waiting for the logger call to finish before it can release a connection.

* Fix cache returning undefined

* Fix typo in comment

* Add padding-right to key in log context

* Always use 'incoming payment failed:'

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2024-11-08 13:26:40 -06:00
k00b dcab8e1365 fix invoice waiting 2024-11-07 19:55:34 -06:00
k00b 544a54399c fix invoice status display 2024-11-07 19:17:50 -06:00
Keyan 0891e51c9e
fix passphrase scanning (#1553) 2024-11-07 16:24:41 -06:00
Keyan 4ad93cd4ab
Merge pull request #1546 from stackernews/fix-1543
fix vault key changes not seen by all instances of useVault
2024-11-05 19:45:16 -06:00
k00b f0a5bc4f27 fix vault key changes not seen by all instances of useVault 2024-11-05 17:25:18 -06:00
Riccardo Balbo 49caec5b63 do not override passed style 2024-11-05 18:06:45 +01:00
Riccardo Balbo 4d8f85508a Use -webkit-text-security to hide passphrase 2024-11-05 17:16:27 +01:00
ekzyis be212d1de9 Fix global wallet logs never fetch logs from server 2024-11-05 00:39:57 +01:00
ekzyis 0901f15249 Fix more button shown after logs deleted by wrapping setLogs 2024-11-04 14:05:41 +01:00
ekzyis 58c37bbd63 Fix more button shown after logs deleted 2024-11-04 13:22:40 +01:00
Keyan d9e9a6722a
Merge pull request #1528 from riccardobl/trace
decode minified stacktrace
2024-11-03 17:28:25 -06:00
k00b a4440c991f add removeLocalWallets fixes from rblb 2024-11-03 01:15:10 -05:00
k00b 25facad5d9 merge master 2024-11-02 19:15:44 -05:00
Riccardo Balbo 1d6f1a962b
Merge branch 'master' into trace 2024-11-03 00:36:30 +01:00
Riccardo Balbo 3b523fe949
Merge branch 'master' into clearbug 2024-11-02 11:45:13 +01:00
Riccardo Balbo 2cd16a68c2
Merge branch 'master' into trace 2024-11-02 11:43:16 +01:00
Keyan 11a5bb5367
Merge branch 'master' into edit-ux 2024-11-01 20:18:49 -05:00
Keyan 2b136715a5
Merge branch 'master' into colored-badges 2024-11-01 19:12:34 -05:00
k00b 1f71a9e187 fix logout purge of localstorage 2024-10-31 15:36:51 -05:00
k00b b8216740d4 final touches 2024-10-31 14:06:58 -05:00
Riccardo Balbo be9b919b60 decode minified stacktrace 2024-10-31 15:43:20 +01:00
k00b 3cfbaf4638 validate generated fields 2024-10-30 22:26:45 -05:00
k00b b1fc341017 sync/desync from localstorage on vault connect/disconnect 2024-10-30 18:37:45 -05:00
k00b 0c8180d89c fix active vault check and optional vaultEntries 2024-10-30 13:49:57 -05:00
k00b dce5762f63 get vault working 2024-10-30 13:49:57 -05:00
k00b eae4c2b882 cancel button spacing 2024-10-30 13:49:57 -05:00
k00b 4f7bdadd80 better wallet security banner 2024-10-30 13:49:57 -05:00
k00b e96982c353 refactor wallet validation 2024-10-30 13:49:57 -05:00
k00b ccdf346954 server side config saves 2024-10-30 13:49:47 -05:00
k00b 4826ae5a7b wip upsertWallet 2024-10-30 13:45:09 -05:00
k00b 2bdbb433df webln saves at least *double kazoo* 2024-10-30 13:45:09 -05:00
k00b 48640cbed6 pages load *kazoo* 2024-10-30 13:45:05 -05:00
k00b da020cf899 complete fantasy scaffolding 2024-10-30 13:44:18 -05:00
Riccardo Balbo fdc3df9c15 force refresh client wallets when device sync is enabled 2024-10-30 13:42:55 -05:00
Riccardo Balbo 3acad86157 improve local storage hook implementation 2024-10-30 13:42:55 -05:00
Riccardo Balbo 86994c4c46 use openConfig instead of useConfig 2024-10-30 13:42:55 -05:00
Riccardo Balbo eeef7039b9 prevent stale me entry from causing vault configurator to delete the local vault key 2024-10-30 13:42:55 -05:00
Riccardo Balbo 4bc669c1c5 prevent double close 2024-10-30 13:42:55 -05:00
Riccardo Balbo 41b86c8251 unsetLocalKey 2024-10-30 13:42:55 -05:00
Riccardo Balbo 1beac3a405 ensure wallet id is in sync before saving the config 2024-10-30 13:41:41 -05:00
Riccardo Balbo 06afe2cda2 remove debug log 2024-10-30 13:41:41 -05:00
Riccardo Balbo 4604a7bac9 use SSR constant 2024-10-30 13:41:41 -05:00
Riccardo Balbo 49cf1f2e23 fix window checks for SSR 2024-10-30 13:41:41 -05:00
Riccardo Balbo b70dbeb6d6 user vault and server side client wallets 2024-10-30 13:41:09 -05:00
ekzyis b50bb2fcc1 Replace unicode currency symbols in inline math 2024-10-28 20:00:00 +01:00
ekzyis 146f578d3d Rename onEdit to toggleEdit 2024-10-25 22:10:15 +02:00
ekzyis 739509de4f Don't hide cancel if still in edit mode 2024-10-25 22:05:29 +02:00
Riccardo Balbo a267f3a476 use useIsClient 2024-10-24 19:58:04 +02:00
Riccardo Balbo 68dafa3684 disable clear button if field is readonly 2024-10-24 16:27:13 +02:00
Riccardo Balbo 9c6e98b47b use effect and state to disable clear button: prevent hydration errors if the field is initialized differently in the client 2024-10-24 16:27:06 +02:00
ekzyis ba06f3043f Color send & recv badges 2024-10-22 21:15:43 +02:00
ekzyis c97ce2627b Rename to autoWithdrawMaxFeeTotal 2024-10-20 15:14:31 +02:00
ekzyis d06f89d707 Change text 2024-10-20 15:14:31 +02:00
ekzyis 596d67fc68 Add max base fee setting 2024-10-20 15:14:31 +02:00
ekzyis 49ddace73f Fix first page of wallet logs loaded twice 2024-10-18 15:10:27 +02:00
ekzyis 70858b97f7 Center more button 2024-10-17 21:22:45 +02:00
ekzyis d91c5c90de Fix infinite loop of loading wallet logs 2024-10-17 21:18:11 +02:00
Keyan 7d139faca1
Merge branch 'master' into upgrade-deps 2024-10-15 11:34:55 -05:00