692 Commits

Author SHA1 Message Date
ekzyis
bf54044a96
Also check for user before setting multi auth cookies (#1941)
* Move multi auth init

* Store same token as we return in jwt callback
2025-03-04 08:58:48 -06:00
k00b
5a8804de79 disallow buying CCs through lnurl-pay and lightning address 2025-03-03 18:03:34 -06:00
soxa
5e7fd693f1
Redirect to top cowboys page if there's a time descriptor (#1913)
* redirect to cowboys.js if there's a time descriptor

* add comment for future reference

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2025-03-01 16:52:37 -06:00
Edward Kung
73170ba8a2
Territory analytics (#1926)
* add territory to analytics selectors

* implement territory analytics, revert user satistics header

* fix linting errors

* disallow some territory names

* fix linting error

* minor adjustments to header

* escape input

* 404 on non-existant sub

* exclude unused queries depending on sub select

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2025-02-28 19:15:18 -06:00
soxa
31532ff830
Dynamic loading optimizations (#1925)
* dynamic: React QR Scanner, React Datepicker; placeholder for syntax highlighting

* Loading placeholders, prevent layout shifting
2025-02-24 15:06:40 -06:00
soxa
7b988b87d9
hotfix: email address should be case insensitive (#1923) 2025-02-23 11:03:32 -06:00
k00b
a4cce7afed only record landing of referree if they don't have referrer 2025-02-12 10:10:25 -06:00
soxa
1afadbdf3b
enhance: referral notifications with source (#1862)
* wip: referral notification shows source of referral

* simpler approach for source info gathering

* fix territory representation; fix fragment field

* cleanup; fix UI

* better margin approach

* hotfix: null check

* add support for comments

* use Union to represent ReferralSource; clarify with switch statements

* cleanup: compact switch statement on Referral resolver

* wip use refereeLanding

* add comments; cleanup

* hotfix: backwards compatibility for Earnings calculation

* small copy and semantics changes

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2025-02-11 20:02:04 -06:00
k00b
ee8fe6e72a add boost badge fix #1860 2025-02-03 19:56:29 -06:00
soxa
be7c702602
Login with magic code (#1818)
* fix: cannot login with email on PWA

* adjust other email templates

* restore manual url on new user email

* no padding on button section

* cleanup

* generate 6-digit bechh32 token

* token needs to be fed as lower case; validator case insensitive

* delete token if user has failed 3 times

* proposal: context-independent error page

* include expiration time on email page message

* add expiration time to emails

* independent checkPWA function

* restore token deletion if successful auth

* final cleanup: remove unused function

* compact useVerificationToken

* email.js: magic code for non-PWA users

* adjust email templates

* MultiInput component; magic code via MultiInput

* hotfix: revert length testing; larger width for inputs

* manual bech32 token generation; no upperCase

* reverting to string concatenation

* layout tweaks, fix error placement

* pastable inputs

* small nit fixes

* less ambiguous error path

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2025-02-03 18:41:01 -06:00
Keyan
01b021a337
comment pagination with limit/offset (#1824)
* basic query with limit/offset

* roughly working increment

* working limiting/pageable queries

* denormalize direct comments + full comments below threshold

* notifications in megathread + working nest view more buttons

* fix empty comment footer

* make comments nested resolver again

* use time in cursor to avoid duplicates

* squash migrations

* do not need item.comments undefined checks
2025-01-29 19:00:05 -06:00
Keyan
4520c91179
cowboy credit modal explainers wherever they are referenced (#1815) 2025-01-12 15:15:53 -06:00
Keyan
146b60278c
cowboy credits (aka nov-5 (aka jan-3)) (#1678)
* wip adding cowboy credits

* invite gift paid action

* remove balance limit

* remove p2p zap withdrawal notifications

* credits typedefs

* squash migrations

* remove wallet limit stuff

* CCs in item detail

* comments with meCredits

* begin including CCs in item stats/notifications

* buy credits ui/mutation

* fix old /settings/wallets paths

* bios don't get sats

* fix settings

* make invites work with credits

* restore migration from master

* inform backend of send wallets on zap

* satistics header

* default receive options to true and squash migrations

* fix paidAction query

* add nav for credits

* fix forever stacked count

* ek suggested fixes

* fix lint

* fix freebies wrt CCs

* add back disable freebies

* trigger cowboy hat job on CC depletion

* fix meMsats+meMcredits

* Update api/paidAction/README.md

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

* remove expireBoost migration that doesn't work

---------

Co-authored-by: ekzyis <ek@stacker.news>
2025-01-03 10:33:07 -06:00
ekzyis
4623743c8f
fix cookie pointer override during account switching (#1783) 2024-12-31 13:05:20 -06:00
ekzyis
ba2cdc2275
Fix NostrAuth link text (#1782) 2024-12-31 08:40:30 -06:00
ekzyis
9783df8e3b
Require invite limit (#1748)
* Fix invite limit required

* Fix redeeming of unlimited invites

* Require invite limit
2024-12-28 09:28:05 -06:00
Riccardo Balbo
6efa782c11
fix typo (#1764) 2024-12-26 13:10:15 -06:00
Keyan
6d4dfddae8
improve rewards (#1731)
* don't bias to early zapping so much

* untested rewards/leaderboard changes

* fix cln dep for payments

* make zap proportion scale using quad root

* fix for missing proportion on hidden users

* improve rewards cutoff criteria

* Update api/resolvers/user.js

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

* Update api/typeDefs/user.js

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

* improve switch readability

* small increase in min zap

* refresh materialized views on migration

---------

Co-authored-by: ekzyis <ek@stacker.news>
2024-12-18 10:12:11 -06:00
Riccardo Balbo
080459cd21
Fix lud-18 validation imports (#1690)
* fix lud18PayerDataSchema import

* fix validateSchema import
2024-12-08 12:37:56 -06:00
Keyan
713227b255
invite paid action (#1681) 2024-12-04 12:10:30 -06:00
ekzyis
01d5177006
Fix edit timer stuck at 00:00 (#1673)
* Fix edit timer stuck at 00:00

* refactor with useCanEdit hook
2024-12-02 08:18:35 -06:00
Riccardo Balbo
7f11792111
Custom invite code and note (#1649)
* Custom invite code and note

* disable autocomplete and hide invite code under advanced

* show invite description only to the owner

* note->description and move unser advanced

* Update lib/validate.js

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

* Update lib/webPush.js

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

* Update api/typeDefs/invite.js

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

* Update pages/invites/index.js

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

* Update pages/invites/index.js

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

* fix

* apply review suggestions

* change limits

* Update lib/validate.js

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>

* don't show invite id in push notification

* remove invoice metadata from push notifications

* fix form reset, jsx/dom attrs, accidental uncontrolled prop warnings

* support underscores as we claim

* increase default gift to fit inflation

---------

Co-authored-by: ekzyis <ek@stacker.news>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2024-12-01 16:31:47 -06:00
Lorenzo
d88971e8e5
Fix: progress bar shown on back navigation through pathname check (#1633)
* fix: progress bar shown on back navigation through pathname check

* fix progress done race

* use router.pathname instead cause it's already there

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2024-11-30 19:05:26 -06:00
Lorenzo
7cb2aed9db
feat: recent unpaid bounties selection (#1589)
* feat: recent unpaid bounties selection

* chore: added checkbox on recent header

* chore: active bounties selection made through a checkbox

* chore: renamed function for better clarity

* chore: fixed active bounties only checkbox alignment

* chore: active-only option passed as query param

* chores: variablesFunc refactoring

* chore: removed type mapping function from recent header

* chore: router replace instead of push

* chore: router retrieved by hook instead of argument

* chore: checkbox starts checked based on url's query param

* more idiomatic react + push instead of replace

---------

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-28 18:47:01 -06:00
ekzyis
5e76ee1844
Remove unused useWallet from QR code component (#1660) 2024-11-27 17:16:44 -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
ekzyis
a032da57b9
Wallet filters (#1627)
* Add wallet filters

* Fix grid layout shift

* Store filter state in query params

* Use auto-fill instead of auto-fit

This doesn't seem to change anything but this is closer to our intention how the grid should work with fixed column width.

* Use same order for filters as icons in card

* Use state update function

* Use user-select: none for wallet filters

* Remove unnecessary '|| false'

* Add media query to keep centered grid layout on small screens

* Decrease wallet filter margin-top to 1rem

* fix wallet support usage

* improve grid

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2024-11-27 11:39:30 -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
cb9947e4f2
refactor: Check darkmode in useWallets (#1640)
* Check darkmode in useWallets

* Check darkmode in useWalletImage
2024-11-23 17:59:59 -06:00
Riccardo Balbo
eb3efbef57
HOTFIX: restore missing link between lnurlp and nip57 (#1630)
* restore missing link between lnurlp and nip57

* pass noteStr as receive action arg

* make sure the desc field is not updated if noteStr is unset
2024-11-21 08:46:28 -06:00
ekzyis
6bae1f1a89
Fix account switching anon login (#1618)
* Always switch to user we just logged in as

If we're logged in and switch to anon and then use login to get into our previous account instead of using 'switch accounts', we only updated the JWT but we didn't switch to the user.

* Fix getToken unaware of multi-auth middleware

If we use login with new credentials while switched to anon (multi_auth.user-id === 'anonymous'), we updated the pubkey because getToken wasn't aware of the switch and thus believed we're logged in as a user.

This is fixed by applying the middleware before calling getToken.
2024-11-20 07:05:42 -06:00
k00b
66ec5d5da8 dark/light mode images on wallet pages 2024-11-19 15:46:11 -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
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
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
afb71012af
Only send push notification if referrer was updated (#1562) 2024-11-09 14:00:07 -06:00
Riccardo Balbo
7eb668e0e2 explicit default values 2024-11-05 16:27:48 +01:00
ekzyis
bcaa135270 Fix wallet priority reorder 2024-11-05 00:40:06 +01:00
k00b
b8216740d4 final touches 2024-10-31 14:06:58 -05: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
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
57603a936f reorder priority 2024-10-30 13:49:57 -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