Commit Graph

1175 Commits

Author SHA1 Message Date
ekzyis 8a19fc0905
Use <Alert> for auth banner in /settings (#1238) 2024-06-12 18:16:54 -05:00
ekzyis cbcae1d128
Fix downzaps (#1236)
* Add optimistic update for downzaps

* Add optimistic update for zaps via dropdown

* Also use lightning strike for downzaps
2024-06-12 13:24:04 -05:00
ekzyis 93713b33df
Optimistic updates via pending sats in item context (#1229)
* Use context for pending sats

* Fix sats going negative on zap undo

We already handle undoing pending sats by wrapping the payment+mutation with try/finally.

* Remove unnecessary ItemContextProvider

* Rename to parentCtx

* Fix hierarchy of ItemContextProvider

If a comment was root and it was zapped, the pending sats contributed to the sats shown in <CommentsHeader>.

This was caused by <CommentsHeader> accessing the root item context for all comments, even for the root comment.

So even if the root comment was zapped, the pending sats contributed to the sats for the comment section.

This wasn't the case for posts since their item context was above the context used by <CommentsHeader>.

This was fixed by moving <ItemProviderContext> down into <Comments> and <Item> instead of declaring it at <ItemFull> which wraps the root item and all comments.

* Optimistic update for poll votes

* prevent twice optimistic zap

* enhance client notifications with skeleton and no redudant queries

* enlarge nwc amount limits

* Disable max amount and daily limit in NWC container

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2024-06-12 08:34:24 -05:00
Tom 569d0448c2
Remove toast error (#1231) 2024-06-11 11:22:20 -05:00
ekzyis 35be035850
More zap undo fixes III (#1228)
* Fix pending state not immediately updated

Before, the bolt wasn't rerendered if the user clicked again within the undo delay since no state changed.

* Fix zap undo pulse only shown on hover
2024-06-06 08:22:05 -05:00
ekzyis 09f9efa189
Remove strike delay (#1227) 2024-06-05 11:49:09 -05:00
ekzyis 23c51df283
Revert reverse refs (#1224)
* Remove reverse internal refs

* Formatting
2024-06-05 08:21:01 -05:00
keyan 2775b49ce7 fix inconsistency in url handling and don't let parseEmbedURL throw 2024-06-04 12:10:37 -05:00
ekzyis ea97fbf4a4
Avoid manual optimistic updates for now (#1220)
* Avoid manual optimistic zap updates for now

* Remove manual optimistic updates for pay-bounty and poll
2024-06-04 03:02:34 -05:00
ekzyis d8fe698963
Fix missing commentId parsing for item mentions (#1219) 2024-06-03 21:54:42 -05:00
SatsAllDay e3571af1e1
Make Polls Anonymous (#1197)
* make polls anonymous

Introduce a `PollBlindVote` DB table that tracks when a user votes in a poll,
but does not track which choice they made.

Alter the `PollVote` DB table to remove the `userId` column, meaning `PollVote`
now tracks poll votes anonymously - it captures votes per poll option,
but does not track which user submitted the vote.

Update the `poll_vote` DB function to work with both tables now.

Update the `item.poll` resolver to calculate `meVoted` based on the `PollBlindVote`
table instead of `PollVote`.

* remove `meVoted` on `PollOption`s

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2024-06-03 13:56:43 -05:00
ekzyis 2597eb56f3
Item mention notifications (#1208)
* Parse internal refs to links

* Item mention notifications

* Also parse item mentions as URLs

* Fix subType determined by referrer item instead of referee item

* Ignore subType

Considering if the item that was referred to was a post or comment made the code more complex than initially necessary.

For example, notifications for /notifications are deduplicated based on item id and the same item could refer to posts and comments, so to include "one of your posts" or "one of your comments" in the title would require splitting notifications based on the type of referred item.

I didn't want to do this but also wanted to have consistent notification titles between push and /notifications, so I use "items" in both places now, even though I think using "items" isn't ideal from a user perspective. I think it might be confusing.

* Fix rootText

* Replace full links to #<id> syntax in push notifications

* Refactor mention code into separate functions
2024-06-03 12:12:42 -05:00
Tom d454bbdb72
Fix issue with popover on full sn links (#1216)
* Fix issue with popover on full sn links

* allow custom text for internal links

---------

Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2024-06-03 12:05:31 -05:00
ekzyis 86b857b8d4
Allow SN users to edit special items forever (#1204)
* Allow SN users to edit special items

* Refactor item edit validation

* Create object for user IDs

* Remove anon from SN_USER_IDS

* Fix isMine and myBio checks

* Don't update author

* remove anon from trust graph

---------

Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2024-06-03 11:26:19 -05:00
Tom 0576716c4a
Close related section (#1207)
* Fix issue with closing accordian

* Use onSelect

* Remove change to AccoridanCard

* Fix className typo

* Restore conditional
2024-05-31 10:20:52 -05:00
ekzyis d2a981ca5d
Add bot badge to items created with API key (#1209) 2024-05-30 16:23:07 -05:00
ekzyis 6047c37e4e
Use refs for modals (#1200)
This fixes concurrent showModal calls with stale values which lead to modals getting replaced instead of stacked.
2024-05-30 09:20:33 -05:00
ekzyis 2e346b488d
Fix missing pointer for anon info (#1201) 2024-05-29 08:32:57 -05:00
ekzyis 30718b9e1b
Fix TypeError due to invalid URL (#1206) 2024-05-29 08:26:42 -05:00
keyan 033270b6ae fix serverside rendering of notifications 2024-05-28 12:55:12 -05:00
ekzyis 94cce9155d
Frontend payment UX cleanup (#1194)
* Replace useInvoiceable with usePayment hook

* Show WebLnError in QR code fallback

* Fix missing removal of old zap undo code

* Fix payment timeout message

* Fix unused arg in super()

* Also bail if invoice expired

* Fix revert on reply error

* Use JIT_INVOICE_TIMEOUT_MS constant

* Remove unnecessary PaymentContext

* Fix me as a dependency in FeeButtonContext

* Fix anon sats added before act success

* Optimistic updates for zaps

* Fix modal not closed after custom zap

* Optimistic update for custom zaps

* Optimistic update for bounty payments

* Consistent error handling for zaps and bounty payments

* Optimistic update for poll votes

* Use var balance in payment.request

* Rename invoiceable to prepaid

* Log cancelled invoices

* Client notifications

We now show notifications that are stored on the client to inform the user about following errors in the prepaid payment flow:

- if a payment fails
- if an invoice expires before it is paid
- if a payment was interrupted (for example via page refresh)
- if the action fails after payment

* Remove unnecessary passing of act

* Use AbortController for zap undos

* Fix anon zap update not updating bolt color

* Fix zap counted towards anon sats even if logged in

* Fix duplicate onComplete call

* Fix downzap type error

* Fix "missing field 'path' while writing result" error

* Pass full item in downzap props

The previous commit fixed cache updates for downzaps but then the cache update for custom zaps failed because 'path' wasn't included in the server response.

This commit is the proper fix.

* Parse lnc rpc error messages

* Add hash to InvoiceExpiredError
2024-05-28 12:18:54 -05:00
nichro dc59153663
Biopage userheader popover (#1198)
* Issue #1180: userheader popover on bio page

* Added import for ItemPopover in user-header.js

* fix linting

---------

Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2024-05-28 09:03:25 -05:00
Tom 52f57f8ac5
Embed Rumble Video (#1191)
* Render Rumble video in preview and posts

* Display Rumble video

* Remove workspace

* Add util function

* Use searchParam for id

* Update check for Rumble

* Update youtube match strings

* fix hostname conditions

---------

Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2024-05-28 08:18:32 -05:00
keyan 211f549a50 fix item skeleton 2024-05-23 10:07:33 -05:00
SatsAllDay 852d2cf304
@remindme bot support (#1159)
* @remindme bot support

support reminders via @remindme bot, just like @delete bot

* minor cleanup

* minor query cleanup

* add db migration

* various fixes and updates:

* hasNewNotes implementation
* actually return notification component in ui
* delete reminder and job on item delete
* other goodies

* refactor to use prisma for deleting existing reminder

* * switch to deleteMany to delete existing Reminders upon edit/delete of post to satisfy prisma

* update wording in form toast for remindme bot usage

* update wording in the push notification sent

* transactional reminder inserts and expirein

* set expirein on @delete too

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2024-05-19 15:52:02 -05:00
ekzyis 7e1c62fdcb
Fix provider default setting (#1183) 2024-05-17 20:27:57 -05:00
ekzyis 7119c2ef0b
Fix QR rerender on WebLN payment (#1181) 2024-05-17 20:27:34 -05:00
Felipe Bueno 471888563e
Item popover (#1162)
* WIP Item Popover

* Hide user on ItemSumarry to avoid infinite popovers

* Introduce HoverablePopover

* Delete itempopover & userpopover css

* Fix excess bottom padding on the ItemPopover

* Fix ItemSummary: Use text for itens that doesn't have a title

* Handling #itemid/something links + Tweaks for rendering comment summary

* refine hoverable popover

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2024-05-15 12:05:50 -05:00
Tom Smith 691818e779
[1124] - Use Mempool For Fee Rate (#1171)
* Use mempool for fee rate

* Add minor logic change

* Restore carousel items
2024-05-15 10:26:49 -05:00
keyan 93e0b3ed6e fix broken lnc localstorage namespace since 5c593ce 2024-05-13 11:08:06 -05:00
keyan 7121317990 more accordian show states 2024-05-13 10:14:35 -05:00
Ben Allen 57fbab31b3
Force post options open when dirty or on errors (#1129)
* wip submit will open options

* fix: options show on error discussions

* lint

* feat: all types check for dirty or errors

* lint

* fix ordering

* dirty and error useEffects

* use formik context

* update dirty checks on forms

* revert dirty logic

* simplify handle error functions

* lint

* add myself to contributors and update awards

* use Formik context in adv-post-form

* move all logic into accordian item

* move logic up to adv-post-form

* lint

* errors open options every time

* refine dirty form accordians

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2024-05-12 16:17:41 -05:00
SatsAllDay 77c87dae80
honor mutes when sending push notifications (#1145)
* honor mutes when sending push notifications for:
* territory subscriptions
* mentions
* user subscriptions

Also, don't allow you to mute a subscribed user, or vice versa

* refactor mute detection for more code reuse

update mute/subscribe error messages for consistency

* variable rename

* move `isMuted` to shared user lib, reuse in user resolver and webpush

* update awards.csv

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2024-05-12 13:55:56 -05:00
Abhi Shandilya 0fda8907e7
fix: show related items on pinned items (#1157)
* fix: show related items on pinned items

* fix condition

* use subName since sub could be undefined

* Update components/item-full.js

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Revert "Update components/item-full.js"

This reverts commit d1b785b8490c9356548ef1bfe246ae526f0237c6.

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-05-11 20:41:59 -05:00
Abhi Shandilya 6ed0e53fc1
fix: custom calendar dark theme (#1123)
* fix: custom calendar dark theme

* refine custom date picker

* color the triangle

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2024-05-11 20:32:44 -05:00
ekzyis 8bc719b3a5
Don't repeat upvote fill color (#1156) 2024-05-07 14:20:22 -05:00
ekzyis 902875bd55
Fix images from media domain not loaded if imgproxyOnly enabled (#1153) 2024-05-06 16:39:20 -05:00
keyan 051cb69f5e fix sharing imgproxy link directly 2024-05-06 12:53:31 -05:00
keyan ce9e146a06 fix missing embellishment in rewards leaderboard 2024-05-06 11:41:02 -05:00
keyan 111053006a fix 'startsWith' call on non-string 2024-05-06 11:26:19 -05:00
keyan 30550e48be reorder mobile bottom nav to be more intuitive 2024-05-04 18:07:09 -05:00
ekzyis 5c593ce280
Fix unintended sharing of wallets and logs (#1127)
* Suffix localStorage key for attached wallets with me.id

* Suffix IndexedDB database name with me.id

* Fix TypeError: Cannot destructure property of 'config' as it is null

* Detach wallet on logout

* Migrate to new storage keys

* Use Promise.catch for togglePushSubscription on logout

It's more concise

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2024-05-03 16:42:00 -05:00
Felipe Bueno 72c27e339c
UserPopover (#1094)
* WIP UserPopover

* Add show delay on UserPopover

* UserDetails -> StackingSince on UserPopover

* Make UserPopover hoverable

* Add felipe to contributors.txt

* Remove export from SocialLink

* Remove @ outside of UserPopover

* userQuery -> useLazyQuery + Handling user not found

* Move styles to user-popover.module.css

* Update components/user-popover.module.css

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* Remove poll + SSR check from useLazyQuery

* USER_FULL -> USER (we are only using stacking since, for now)

* refine user popover

---------

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2024-05-03 16:39:21 -05:00
keyan cdeaa35ff4 fix new logger.error undefined 2024-05-03 14:49:31 -05:00
Ben Allen 64de3c3b94
Add explicit word break for items (#1137)
* add word break for notification items when they are too long

* don't use global css
2024-05-03 14:18:50 -05:00
ekzyis 4961cc045b
Allow deletion of wallet logs (#1101)
* Allow deletion of wallet logs

* Refactor wallet logs client<>server glue code

* Use variant='link' and className='text-muted fw-bold nav-link' for clear & cancel

There is a bug though: 'clear' stays highlighted after modal is closed

* Include wallet in toast

* Delete logs on logout

* Fix ugly wallet name in confirm dialog

* Fix clear still highlighted after modal closed

* Only delete client wallet logs

* Fix ugly wallet name in toast

* Fix bad search and replace

* Use Wallet object as constant

* Also delete LNC logs on logout

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2024-05-03 14:14:33 -05:00
itsrealfake e5f8c4e8e8
closes #1096 (#1130) 2024-05-03 14:09:27 -05:00
Keyan fd2008e5d1
reintroduce daily rewards (#1134)
* reintroduce daily rewards

* update reward sponsor

* daily rewards countdown

* update rewards job schedule
2024-05-01 09:30:36 -05:00
keyan 54bbb0cc52 fix #1132 broken satistics links 2024-04-30 17:52:34 -05:00
ekzyis 84b4d98c5c
Fix missing logger.error and setStatus (#1122) 2024-04-29 11:57:35 -05:00
ekzyis bd37ec17cc
Use njump.me for nostr links (#1120)
njump is what is powering the preview in nostr.com so it seems more fitting to directly go to njump.me

See https://github.com/fiatjaf/njump
2024-04-28 17:25:25 -05:00
Abhi Shandilya bddc2b1508
fix: hide related posts in deleted item (#1119) 2024-04-28 17:17:19 -05:00
Ben Allen 8a735791ce
Add dashboard to satistics page (#1099)
* updated graphs ad queries

* fixed query

* fixed graph data pull

* converted msats to sats

* linter fix

* Fixed labels for graphs

* linter

* linter

* feat: style header

* lint

* fix: mobile navbar link and graph titles

* style charts

* change key names

* refine satistics graphs

---------

Co-authored-by: Dillon <dilloncortez@gmail.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2024-04-28 16:05:23 -05:00
ekzyis 0f95eb6c36
Only provide WebLN if enabled (#1115)
Co-authored-by: ekzyis <ekzyis@ekzy.is>
2024-04-28 11:03:07 -05:00
keyan b8e153a4be deal with webln unlock in sendPayment 2024-04-27 20:00:54 -05:00
keyan 4a14e0342b don't allow lnc edits because they won't work 2024-04-27 19:02:16 -05:00
keyan 2da3762d40 unattach -> detach 2024-04-27 18:37:57 -05:00
keyan da71103e42 clear lnc state on detach 2024-04-27 18:37:57 -05:00
Keyan c3d709b025
add lnc attached wallet (#1104)
* add litd to docker env

* lnc payments

* handle locked wallet configuration

* create new lnc connection for every action

* ensure creds are decrypted before reconnecting

* perform permissions check
2024-04-26 21:22:30 -05:00
keyan 2340df3d8f update footer 2024-04-26 11:26:01 -05:00
Ben Allen 255f97a2b3
flip the icons for consistent UX (#1100) 2024-04-23 09:46:27 -05:00
Ben Allen ecedbd1527
Add PasswordInput component (#1090)
* feat: add PasswordHider

* feat: add PasswordInput

* fix typo and require requirement

* merge state

* use ...props and lnbits password required

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2024-04-21 17:28:57 -05:00
SatsAllDay fbd3f8efed
introduce `persistOnNavigate` option for toasts (#1095)
ensure that post auto-delete success toasts are preserved
when navigating back to the prior page
2024-04-21 17:25:48 -05:00
SatsAllDay d7ecbbae3a
Search bookmarks (#1075)
* Support `is:bookmarked` search option to search my bookmarked items

* Update the worker search module to include `bookmarkedBy: Array<Number>` which
contains the list of user ids which have bookmarked a given item

* Add a trigger on the `Bookmark` DB table to re-index the corresponding item when
a bookmark is added/removed

* Update the Search resolver to check for a `is:bookmarked` query option. If provided,
include it as an option in the search request. This updates search to look for items
which are bookmarked by the current user. By default, this preserves stacker privacy
so you can only search your own bookmarks

* Update the search page UI to show how to invoke searching your own bookmarks

* undo `is:bookmarked` support, add `bookmarks` item in search select

* short circuit return empty payload for anon requesting bookmarks

* remove console.log for debugging

* fix indexing a new item that has yet to be bookmarked

* update db migration to re-index all existing bookmarked items one time

* fix the case where deleting a bookmark doesn't trigger a new index of items

explictly specify a `updatedAt` value when deleting a bookmark, to ensure that
deleting a bookmark results in a new indexed version of the bookmarked item

* update search indexer to use the latest of all three choices for the latest version

* give bookmark index jobs longer expiration

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2024-04-19 13:24:48 -05:00
keyan a77f778f27 fix hidden wallet balance layout shift 2024-04-17 17:22:17 -05:00
keyan f9a99a7deb give 1 sat fee button overlay but not button text 2024-04-17 14:22:31 -05:00
keyan 0ea261428c give edit and countdown space again 2024-04-17 13:19:10 -05:00
ekzyis 40463d526c
Fix TypeError: Failed to construct 'URL': Invalid URL (#1083) 2024-04-17 12:15:36 -05:00
keyan 058f88da49 add halving to price carousel 2024-04-16 17:58:26 -05:00
keyan a0f3e338a8 fix shift when loading paid invoice 2024-04-16 16:28:22 -05:00
keyan 052e36f6ed adjust qr skeleton for bolt11info 2024-04-16 16:20:13 -05:00
keyan 02fe4d5d92 update qr skeleton 2024-04-16 16:05:59 -05:00
keyan 1a25179a98 modal spacing fixes 2024-04-16 15:33:00 -05:00
ekzyis e30dfbae57
Fix autowithdrawal logs (#1073)
* Also log autowithdrawal routing errors

* Only log autowithdrawal success in worker

* Use WalletType for WalletLog.wallet

* Fix autowithdrawal success message

* Infer walletName from walletType in upsertWallet
2024-04-16 13:59:46 -05:00
ekzyis 796bd4dc4b
Add autowithdrawal badge in notifications (#1078) 2024-04-16 10:53:05 -05:00
keyan 5689378b07 turn #1063 logic into a component for use in all comment lists 2024-04-15 16:23:26 -05:00
ekzyis 9f4d5e13aa
CLN autowithdrawal (#1042)
* Add CLN node to docker-compose.yml

* Attach CLN wallet via CLNRest

* Remove leading space

* Implement autowithdrawal to CLN in worker

* Fix UnhandledSchemeError during build

See https://github.com/vercel/next.js/discussions/33982

* Refactor CLN invoice code into @/lib/cln

* Fix missing env vars

* Fix validation error if rune invalid

* Update header

* Add rune placeholder

* Fix missing expiry for test invoice

* Remove nonsensical comment

* Remove unnecessary async

* Show level SUCCESS as OK in logs

* Add stacker_cln commands to sndev

* fix sndev posix compliance, add cln_withdraw

* give stacker_cln larger channels

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2024-04-14 17:34:21 -05:00
Keyan 0fb2e95729
anchor box for notifications (#1063)
* anchor box for notifications closes #202

* fix lint

* give priority click children pointer events too

* add iframe and simplify css
2024-04-13 13:14:17 -05:00
✨JP⚡ a28d690f28
Fix first zap when modal closed (#771) (#1055)
* Fix first zap when modal closed (#771)

 - Extract handlers
 - Remove unnecessary async keyword from callback
 - Assign a new key to force remounting of LongPressable component when modal is closed from long press
 - Remove hover state when closing modal, otherwise it stays colored

* Replace LongPressable with custom component

* Remove yarn.lock
2024-04-12 18:37:04 -05:00
abhiShandy 6d57bbffe5
fix: feetext defaults to free (#1031)
* fix: feetext defaults to free

* Update components/fee-button.js

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

---------

Co-authored-by: ekzyis <ek@stacker.news>
2024-04-09 11:12:24 -05:00
keyan 81d3212ffb add NEXT_PUBLIC_URL 2024-04-08 17:54:39 -05:00
Ben Allen 5be6df0266
Internal links are not target=_blank by default (#1037)
* feat: internal links are not target=_blank by default

* feat: use <Link>

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2024-04-08 16:56:44 -05:00
Felipe Bueno 4633e8eb5e
Allow pasting image from clipboard (#1043)
* form.js: Allow pasting image from clipboard

* remove semicolons

* Check clipboardData.items before continuing

* == -> ===

* Remove semicolons... again =/

* fix Strings must use singlequote

* Ignore DataTransfer no-undef lint error

* new DataTransfer -> new window.DataTransfer()

* add multiple image pasting

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2024-04-08 16:31:02 -05:00
SatsAllDay e6b825dafe
Mute Management Settings Page (#1034)
* first pass of a mute mgmt page, ported from subscription mgmt page pr

* adjust error message for mutes

* muted users -> muted stackers

* fix typo in component name
2024-04-08 09:13:56 -05:00
SatsAllDay 91a0d1ccd7
env vars for polling intervals (#1038)
* env vars for polling intervals

add env vars for 4 different common polling intervals,
fast (1000), normal (30000), long (60000), extra long (300000)

use env vars in all `pollInterval` params to `useQuery`

* replace `setInterval`'s interval with `FAST_POLL_INTERVAL`
2024-04-08 09:13:12 -05:00
keyan 1d154ec9b5 attempt to fix lastChecked getting overwritten 2024-04-06 18:28:23 -05:00
ekzyis ba8b37ffb9
Add missing space in front of founding date (#1027) 2024-04-05 11:52:11 -05:00
Ben Allen 5fa7fd9a83
Bottom nav uses fixed position to fix firefox bug (#1011)
* use fixed position + div placeholder

* hide footer padding when not shown

* account for mobile inset

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2024-04-04 18:50:52 -05:00
keyan e7fec21375 fix hidden wallet layout shift 2024-04-04 18:07:59 -05:00
keyan b995035f46 prevent contexts causing rerenders 2024-04-04 17:52:59 -05:00
Felipe Bueno a0e705b1c0
Just some minor fixes (#1012)
* Add .vscode/settings.json to .gitignore to allow local vscode settings without making the work tree dirty

* Swap (fix) Login & SignUp button ids + Make them both 112px wide
2024-04-04 16:31:53 -05:00
keyan 2bf11dc848 remove reliance on intersection observer 2024-04-04 15:38:27 -05:00
ekzyis 9d897e9bf7
Use same onclose listener in sendPayment (#1020)
This is the onclose listener from getInfo.

This might also be a potential fix for undefined errors that I am getting.

With "undefined errors" I mean that the error itself is literally undefined.
2024-04-04 12:28:52 -05:00
ekzyis 6e75b9d274
Fix effect dependencies (#1019)
* Fix missing effect dependencies

* Remove unnecessary effect dependency
2024-04-04 12:23:49 -05:00
nl 32ea514286
less confusing expression for the hint of when the autowithdraw will be initiated (#1015)
* less confusing expression of when the autowithdraw will be initiated

* only change display value

* tentatively resolved linting errors: spacing around * and removed unused var import
2024-04-04 09:18:41 -05:00
ekzyis ebcdc21728
Remove useRef for NWC relay (#1014)
* Remove useRef for NWC relay

* connect to relay for every payment for more reliable payments
* remove getInfoWithRelay method (no longer needed since we no longer use useRef)
* fix 'WebSocket is already in CLOSING or CLOSED state.' errors
* improve logging

* Log connection failures

* Fix no error thrown on validation error
2024-04-04 08:29:39 -05:00
SatsAllDay 992fc54160
Subscription management page (#1000)
* first pass of a subscription management page under settings

* add tabs to settings ui

* NymActionDropdown

* update Apollo InMemoryCache to merge paginated list of my subscribed users

* various updates

* switch from UsersNullable to Users

* bake the nym action dropdwon into the user component

* add back fields to the user query

* `meSubscriptionPosts`, `meSubscriptionComments`, `meMute`

* Refetch my subscribed users when a user subscription is changed

* update user list to hide stats in the subscribed list users

* update my sub'd users fragment to remove unnecessary user fields

* memoize subscribe user context provider value to avoid re-renders

* use inner join instead of left join

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

* throw error when unauthenticated

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-04-03 19:38:47 -05:00
ekzyis 15fb7f446b
Wallet Logs (#994)
* nwc wallet logs

* persist logs in IndexedDB

* Potential fix for empty error message

* load logs limited to 5m ago from IDB

* load logs from past via query param

* Add 5m, 1h, 6h links for earlier logs

* Show end of log

* Clamp to logStart

* Add log.module.css

* Remove TODO about persistence

* Use table for logs

* <table> fixes bad format with fixed width and message overflow into start of next row
* also using ---start of log--- instead of ---end of log--- now
* removed time string in header nav

* Rename .header to .logNav

* Simply load all logs and remove navigation

I realized the code for navigation was most likely premature optimization which even resulted in worse UX:
Using the buttons to load logs from 5m, 1h, 6h ago sometimes meant that nothing happened at all since there were no logs from 5m, 1h, 6h ago.
That's why I added a time string as "start of logs" so it's at least visible that it changed but that looked bad so I removed it.

But all of this was not necessary: I can simply load all logs at once and then the user can scroll around however they like.

I was worried that it would be bad for performance to load all logs at once since we might store a lot of logs but as mentioned, that's probably premature optimization.

WHEN a lot of logs are stored AND this becomes a problem (What problem even? Slow page load?), THEN we can think about this.

If page load ever becomes slow because of loading logs, we could probably simply not load the logs at page load but only when /wallet/logs is visited.

But for now, this works fine.

* Add follow checkbox

* Create WalletLogs component

* Embed wallet logs

* Remove test error

* Fix level padding

* Add LNbits logs

* Add logs for attaching LND and lnAddr

* Use err.message || err.toString?.() consistently

* Autowithdrawal logs

* Use details from LND error

* Don't log test invoice individually

* Also refetch logs on error

* Remove obsolete and annoying toasts

* Replace scrollIntoView with scroll

* Use constant embedded max-height

* Fix missing width: 100% for embedded logs

* Show full payment hash and preimage in logs

* Also parse details from LND errors on autowithdrawal failures

* Remove TODO

* Fix accidental removal of wss:// check

* Fix alignment of start marker and show empty if empty

* Fix sendPayment loop

* Split context in two
2024-04-03 17:27:21 -05:00
JP a7105b90f2
Fix title from draft being dismissed (#718) (#991)
* Fix title from draft being dismissed

Add a way to bypass the title generation query when the url change is from local storage (draft) and not user interaction.

* Check draft title from storage

* Remove unused
2024-04-03 16:13:20 -05:00
Keyan 5a1f39d076
Merge pull request #1008 from stackernews/territory-header-createdAt
Add founding date to territory header
2024-04-03 13:00:00 -05:00
keyan a764837776 update redirection logic for invites 2024-04-02 19:51:30 -05:00
ekzyis 3cd80a54f6 Add createdAt to territory header 2024-04-03 01:17:32 +02:00
keyan 1e3a836fbc update reward notification for msm 2024-03-30 18:46:01 -05:00
keyan ef5a92dff4 match offcanvas nym position to navbar 2024-03-28 18:57:42 -05:00
keyan 9820055aee refine hiding bottom navbar when virtual keyboard opens 2024-03-28 18:18:44 -05:00
keyan 176d0e2e77 fix weird ios sticky behavior with virtual keyboard 2024-03-28 17:35:08 -05:00
keyan b2616bdfdb change order of bell and post button for symettry 2024-03-28 16:35:21 -05:00
keyan 7dac5e79a6 prioritize showing wallet balance over price carousel 2024-03-28 16:32:53 -05:00
keyan 79b894514b fix sticky gap on some android devices 2024-03-28 16:17:05 -05:00
keyan d5a018e48d hide bottom navigation when virtual keyboard is shown 2024-03-28 16:03:45 -05:00
keyan ce5d01037a use safe-area-inset-bottom for bottom nav padding 2024-03-28 12:57:27 -05:00
keyan 97927c1f9a consistent sticky search spacing 2024-03-28 12:37:26 -05:00
keyan dfc3d7dfa6 fix nav spacing 2024-03-28 12:33:58 -05:00
ekzyis dcb7205278 Fix alignment in modal 2024-03-28 17:10:05 +01:00
Keyan 4c2fcec69b
Merge pull request #982 from stackernews/nav
Improved navigation with dedicated mobile navigation
2024-03-27 16:53:19 -05:00
keyan 6054afa10c simplify logic determining if territory select is shown 2024-03-27 16:29:04 -05:00
keyan 2575a4a494 offcanvas style and login fixes 2024-03-27 14:41:02 -05:00
keyan f0911fde04 more spacing consistency 2024-03-27 14:04:04 -05:00
keyan 316418327a make recent/top have consistent spacing 2024-03-27 13:44:36 -05:00
Keyan df7e944bf8
Merge pull request #980 from stackernews/hashed-api-keys
Hash API keys with SHA-256 before storing them
2024-03-27 13:02:57 -05:00
ekzyis 48342bc246 Fix typo 'visibile' 2024-03-27 15:45:17 +01:00
keyan e1f183f48a navigation -> nav 2024-03-26 19:49:10 -05:00
keyan b884bde24d check for new notifications in context/singleton 2024-03-26 19:35:18 -05:00
keyan bfe5edcfe3 search all territories by default + more intuitive search filters 2024-03-26 18:37:40 -05:00
keyan f2ba61e64b enhance navigation 2024-03-26 18:36:31 -05:00
ekzyis 121205fa4b Add delete obstacle 2024-03-26 22:33:18 +01:00
Keyan a93fea4a1f
Merge pull request #975 from benalleng/option-key-prop
Add index to make unique key props on territory options
2024-03-26 14:31:43 -05:00
benalleng e36b77ad68 fix: add index to make unique key props on territory options 2024-03-26 15:28:26 -04:00
Keyan b18b5d1638
Merge pull request #974 from felipebueno/reader_view_compatibility
Enable readerView compatibility (issue #884)
2024-03-26 14:00:50 -05:00
Felipe Bueno 170bf7464b fullItemContainer div -> article to make it compatible with browser's reader view 2024-03-26 14:10:18 -03:00
Keyan 3730b89667
Merge pull request #972 from benalleng/issue923
Allow links to be fit to their content on the homepage
2024-03-26 11:00:56 -05:00
benalleng dc87594d92 feat: add max-width fit-content 2024-03-26 09:58:48 -04:00
ekzyis 922d2394fd Remove unnecessary withdrawl field 2024-03-26 02:10:46 +01:00
ekzyis 3388f818cf Add withdrawal notifications 2024-03-26 00:50:48 +01:00
Keyan 3a00695041
Merge pull request #965 from stackernews/zap-undo-threshold
Use thresholds to trigger zap undos
2024-03-25 17:34:10 -05:00
Keyan e60f1b80d3
Merge pull request #962 from stackernews/more-zap-undo-fixes
More zap undo fixes II
2024-03-25 17:32:30 -05:00
Keyan 59b0027ad0
Merge pull request #970 from AustinKelsay/bugfix-crosspost-link-context
Add context field to crossposted link if present
2024-03-25 17:25:22 -05:00
austinkelsay a9506c4532 Add context field to crossposted link if present 2024-03-25 17:16:45 -05:00
Satoshi Nakamoto 263d0cc425 remove duplicative styles 2024-03-25 15:35:32 -04:00
Satoshi Nakamoto 32bc483e48 chart skeletons 2024-03-25 15:35:32 -04:00
ekzyis c2aef34ba2 Add threshold for zap undos 2024-03-25 20:34:28 +01:00
ekzyis 42d7a31584 Fix custom zap modal closed after zap undo 2024-03-25 20:32:23 +01:00
ekzyis 0193ac97fe Fix toast progress bar jump due to end flow hack
If an underlying toast finished, an empty toast that automatically immediately hides was dispatched to end the flow ("end flow hack").

If this empty toast had the same tag, the code marked the top toast as hidden even though it was not hidden.

This meant that during render, the animation-delay for the top toast (which was already rendered) was added again, leading to a progress bar jump.

This is fixed by no longer using this "end flow hack" where a toast is dispatched but a dedicated function to end flows.
2024-03-25 20:32:23 +01:00
ekzyis 17071fa615 Add missing tag to custom zap toasts 2024-03-25 20:32:23 +01:00
keyan e8f9a186c6 fix image url construction 2024-03-20 14:18:11 -05:00
ekzyis d237861ff5
Use module path aliases (#938)
* Use module path aliases

* fix broken refactor

* path mapping for svgs, style, and remaining places (bonus: lose babel dep)

---------

Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2024-03-19 19:37:31 -05:00
ekzyis 687d71f246
Purchase archived territories (#897)
* Handle archived territories in territory form

* Use dedicated mutation

* Add sanity check for eternal territories

* Fix fields and cost ignored

* Remove no longer needed manual validation in upsertSub

* Remove founder check

* Always check if sub is archived

Using { abortEarly: false } now since previously, if no description was not given, we wouldn't detect if the sub was archived since validation would abort on empty descriptions.

Only on submission all fields would get validated but since we ignore archived errors during submission, the user would never see that the sub is archived before submission
+ the wrong mutation would run if archived is not already true before submission.

Hence, we need to validate all fields always.

There is currently still a bug where the validation does not immediately run but maybe this can be fixed by simply using validateImmediately on the Formik component.

* Fix archived warning not shown after first render

* Only create transfers if owner actually changes

* Reuse helper functions in lib/territory.js

* Rename var to editing

* Use onChange instead of validation override

* Run same validation on server for unarchiving

* Fix 'territory archived' shown during edits

* Use && instead of ternary operator for conditional query

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2024-03-19 17:23:59 -05:00
Keyan 18d126c610
Merge pull request #929 from stackernews/referral-link-privacy-setting
Add setting for no referral links on copy
2024-03-17 12:55:33 -05:00
ekzyis 5b15fd88a9 Fix ToC due to repeated slug calls 2024-03-17 18:24:39 +01:00
ekzyis 2ba4063645 Add setting for no referral links on copy 2024-03-17 16:23:03 +01:00