Commit Graph

1204 Commits

Author SHA1 Message Date
k00b 81897461e3 fix qrcode display after upgrade 2024-10-12 18:06:07 -05:00
k00b f9ed1ee6f5 upgrade non-(apparently)-breaking major versions 2024-10-12 18:06:07 -05:00
k00b 021a13d21e fix anon badge 2024-10-12 18:05:45 -05:00
Keyan 245419185f
wallet streaks (#1468)
* wallet streaks backend

* notifications and badges

* reuseable streak fragment

* squash migrations

* push notifications

* update cowboy notification setting label text
2024-10-11 19:14:18 -05:00
ekzyis 41da95b125
Fix wallet double tap on mobile (#1467)
* Fix wallet double tap on mobile

* also add icon that card can be dragged

* Fix ugly drag image
2024-10-09 19:27:49 -05:00
k00b 070b350211 catch when indexeddb is not available fix #1462 2024-10-07 10:51:25 -05:00
k00b 153455983e Revert "Encrypted device sync (#1373)"
This reverts commit a9a566a79f.
2024-10-04 15:00:13 -05:00
Keyan 5543a0755a
paginating wallet logs (#1459)
* paginating wallet logs

* refine
2024-10-04 06:59:32 -05:00
k00b 00bcd8c992 fix #1451 2024-10-02 21:23:16 -05:00
k00b dff452f00f mathjax close #1436 2024-10-02 19:52:05 -05:00
Keyan f4382ad73e
better boost hints (#1441)
* better boost hints

* refine
2024-10-02 19:24:01 -05:00
k00b 65a7ef10d0 make bio work as paid action 2024-10-02 18:39:56 -05:00
k00b 5fab3abb82 fix bio quirks 2024-10-02 18:12:49 -05:00
Keyan 4ce395889d
Be kind to lnd (#1448)
* cache or remove unecessary calls to lnd

* avoid redundant grpc calls in state machine

* store preimage whenever available

* enhancements post self-code review

* small refinements

* fixes

* fix lnurl-verify

* prevent wallet logger throwing on idb close

* fix promise in race while waiting for payment
2024-10-02 15:03:30 -05:00
Riccardo Balbo a9a566a79f
Encrypted device sync (#1373)
* user vault

* code cleanup and fixes

* improve ui

* prevent name collisions between users on the same device

* some improvements

* implement storage migration

* comments and cleanup

* make connect button primary instead of warning

* move show passphrase in new line (improvement for small screen devices)

* make show passphrase field readOnly

* fixes

* fix vault key unsync

* implicit migration

* move device sync under  general tab

* fix locally disabled wallets and default wallet selection

* improve text

* remove useless SSR check

* add auth checks

* Rename variables

* Fix missing await

* Refactor local<>vault storage interface

I've changed quite some things here. Attempt of a summary:

* storageKey is now only controlled by useVaultStorageState

I've noticed that dealing with how storage keys are generated (to apply user scope) was handled in two places: the existing wallet code and in the new vault code.

This was confusing and error-prone. I've fixed that by completely relying on the new vault code to generate correct storage keys.

* refactored migration

Migration now simply encrypts any existing local wallets and sends them to the server. On success, the local unencrypted version is deleted.

The previous code seemed to unnecessarily generate new local entries prefixed by 'vault:'.

However, since we either use unencrypted local state OR use the encrypted vault on the server for the data, I didn't see any need for these.

Migration seems to work just as well as before.

* removed unnecessary state

In the <DeviceSync> component, enabled & connected were using a unnecessary combo of useState+useEffect.

They were only using variables that are always available during render so simple assignments were enough.

* other minor changes include:

  * early returns
  * remove unnecessary SSR checks in useEffect or useCallback
  * formatting, comments
  * remove unnecessary me? to expose possible bugs

* Fix missing dependency for useZap

This didn't cause any bugs because useWallet returns everything we need on first render.

This caused a bug with E2EE device sync branch though since there the wallet is loaded async.

This meant that during payment, the wallet config was undefined.

* Assume JSON during encryption and decryption

* Fix stale value from cache served on next fetches

* Add wallet.perDevice field

This adds 'perDevice' as a new wallet field to force local storage. For example, WebLN should not be synced across devices.

* Remove debug buttons

* Rename userVault -> vault

* Update console.log's

* revert some of the migration and key handling changes. restore debug buttons for testing

* Fix existing wallets not loaded

* Pass in localOnly and generate localStorageKey once

* Small refactor of migration

* Fix wallet drag and drop

* Add passphrase copy button

* Fix priorityOnly -> skipTests

* Disable autocompletion for reset confirmation prompt

* Show wrong passphrase as input error

* Move code into components/device-sync.js

* Import/export passphrase via QR code

* Fix modal back button invisible in light mode

* Fix modal closed even on connect error

* Use me-2 for cancel/close button

* Some rephrasing

* Fix wallet detach

* Remove debug buttons

* Fix QR code scan in dark mode

* Don't allow custom passphrases

* More rephrasing

* Only use schema if not enabled

* Fix typo in comment

* Replace 'generate passphrase' button with reload icon

* Add comment about IV reuse in GCM

* Use 600k iterations as recommended by OWASP

* Set extractable to false where not needed

* use-vault fallbacks to local storage only for anonymous users

* fix localStorage reset on logout

* add copy button

* move reset out of modals

* hide server side errors

* hardened passphrase storage

* do not show passphrase even if hardened storage is disabled (ie. indexeddb not supported)

* show qr code button on passphrase creation

* use toast for serverside error

* Move key (de)serialization burden to get/setLocalKey functions

* password textarea and remove qr

* don't print plaintext vault values into console

---------

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-10-01 14:55:01 -05:00
k00b 861e944fe1 fix item full embed for the 3rd and final(?) time 2024-09-30 12:37:33 -05:00
k00b 865cdccb2a fix item full embed param 2024-09-30 12:24:06 -05:00
k00b bbdc37ffd4 fix missing src on autolinks 2024-09-29 11:13:33 -05:00
k00b 6f198fd1ca dark mode for nostr embed 2024-09-28 20:02:33 -05:00
k00b 4f158a98a8 fix link item embed regression 2024-09-28 19:17:15 -05:00
Keyan cc4bbf99e4
fixes #1395 (#1430)
* fixes #1395

* rehype plugin for embeds

* fix lint

* replace many plugins with one rehype and improve image collage

* remove unused css

* handle more custom markdown behavior in rehype

* refactor markdown rendering more + better footnotes

* move more markdown logic to reyhpe plugin + better headers

* fix #1397

* refactor embeds out of media-or-link
2024-09-28 16:33:07 -05:00
ekzyis 9f79d588a8
Image carousel (#1425)
* Add image carousel in fullscreen

* Flip through all images of a post

* Disable image selection in fullscreen

* Keep max-width: 100vw for images

* Fix missing dependency

* fix merge resolve bug

* better css

* refactor, keypress/swipe events, remove scoll

* changes after self-review

* give previews their own carousel

* hooks for arrow keys and swiping

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2024-09-26 17:37:13 -05:00
k00b 5371e1abf8 fix bounty paid action notification 2024-09-26 09:53:25 -05:00
k00b 0d4c8cdc23 no optimistic item repetition for anon 2024-09-26 09:44:14 -05:00
k00b b3c8d32d5a remove debug log comment 2024-09-25 18:04:03 -05:00
k00b 3f49c93ecb update item repetition optimistically 2024-09-25 18:02:40 -05:00
k00b 68f7e4111b prevent shift on pending -> paid 2024-09-25 17:38:37 -05:00
Keyan 9f06fd65ee
UX latency enhancements for paid actions (#1434)
* prevent multiple retries & pulse retry button

* fix lint

* don't wait for settlement on pessimistic zaps

* optimistic act modal
2024-09-25 13:32:52 -05:00
Keyan 450c969dfc
allow edit of pending items (#1431) 2024-09-24 15:42:32 -05:00
ekzyis 1641b58e55
CSS animation for toasts and offcanvas (#1432)
* CSS animation for toasts

* Smaller toasts

* CSS animation for offcanvas

* faster animations and toast from the bottom

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2024-09-24 13:43:15 -05:00
Keyan 76218dccac
batch zap requests (#1424) 2024-09-24 09:38:48 -05:00
ekzyis 18fbd17025
CTRL+U for uploads (#1423) 2024-09-23 20:08:37 -05:00
k00b 2b5a1cbfe9 more reply placeholders 2024-09-22 12:05:03 -05:00
ekzyis d30dace266
Fix missing dependency for useZap (#1420)
This didn't cause any bugs because useWallet returns everything we need on first render.

This caused a bug with E2EE device sync branch though since there the wallet is loaded async.

This meant that during payment, the wallet config was undefined.
2024-09-22 11:03:38 -05:00
k00b 101574b605 fix territory revenue notification 2024-09-20 11:07:15 -05:00
k00b f90a9905ba unzapped bolt shouldn't glow 2024-09-20 10:41:46 -05:00
k00b 8447a4a8b2 boost icon refinement 2024-09-20 10:15:44 -05:00
k00b 4981d572bb show boost for when forwardee 2024-09-20 09:58:53 -05:00
ekzyis 4e7b4ee571
Fix upvote hover style not showing for first zap (#1418) 2024-09-20 09:44:15 -05:00
k00b 2f191e04f9 ek boost hint suggestions 2024-09-19 15:27:09 -05:00
k00b 020b4c5eea allow comment updates when they have boost 2024-09-19 14:06:34 -05:00
k00b e323ed27c6 fix boost hint for comments 2024-09-19 13:42:59 -05:00
Keyan 5f0494de30
rethinking boost (#1408)
* reuse boost for jobs

* wip

* allow job stopping

* restore upvote.js

* expire boost

* boost beyond edit window

* fix boost bolt styling

* rank comments with boost

* no random sort for jobs

* top boost for month at top of territory

* boost hints

* more boost help

* squash migrations

* for same boost, prioritize older

* show ad only if active

* fix itemCreate/Update boost expiration jobs

* fix fee button precedence
2024-09-19 13:13:14 -05:00
k00b d46ae03598 attempt to fix img shift 2024-09-16 12:00:15 -05:00
k00b 404cb0aaa7 fixes for toplevel media embeds 2024-09-16 11:54:22 -05:00
k00b d9213da268 fix overflowed image 2024-09-14 19:25:25 -05:00
k00b 12d2e99576 fix inline image shrinking 2024-09-14 18:22:11 -05:00
k00b df65104c60 fix text/media component styling 2024-09-13 20:40:40 -05:00
k00b 2018cc1f0b fix image height in certain contexts 2024-09-13 19:14:49 -05:00
ekzyis 7c68eafa56
Fix hat contrast in profile in dark mode (#1406) 2024-09-13 19:05:16 -05:00