Commit Graph

40 Commits

Author SHA1 Message Date
ekzyis a6713f9793
Account Switching (#644)
* WIP: Account switching

* Fix empty USER query

ANON_USER_ID was undefined and thus the query for @anon had no variables.

* Apply multiAuthMiddleware in /api/graphql

* Fix 'you must be logged in' query error on switch to anon

* Add smart 'switch account' button

"smart" means that it only shows if there are accounts to which one can switch

* Fix multiAuth not set in backend

* Comment fixes, minor changes

* Use fw-bold instead of 'selected'

* Close dropdown and offcanvas

Inside a dropdown, we can rely on autoClose but need to wrap the buttons with <Dropdown.Item> for that to work.

For the offcanvas, we need to pass down handleClose.

* Use button to add account

* Some pages require hard reload on account switch

* Reinit settings form on account switch

* Also don't refetch WalletHistory

* Formatting

* Use width: fit-content for standalone SignUpButton

* Remove unused className

* Use fw-bold and text-underline on selected

* Fix inconsistent padding of login buttons

* Fix duplicate redirect from /settings on anon switch

* Never throw during refetch

* Throw errors which extend GraphQLError

* Only use meAnonSats if logged out

* Use reactive variable for meAnonSats

The previous commit broke the UI update after anon zaps because we actually updated item.meSats in the cache and not item.meAnonSats.

Updating item.meAnonSats was not possible because it's a local field. For that, one needs to use reactive variables.

We do this now and thus also don't need the useEffect hack in item-info.js anymore.

* Switch to new user

* Fix missing cleanup during logout

If we logged in but never switched to any other account, the 'multi_auth.user-id' cookie was not set.

This meant that during logout, the other 'multi_auth.*' cookies were not deleted.

This broke the account switch modal.

This is fixed by setting the 'multi_auth.user-id' cookie on login.

Additionally, we now cleanup if cookie pointer OR session is set (instead of only if both are set).

* Fix comments in middleware

* Remove unnecessary effect dependencies

setState is stable and thus only noise in effect dependencies

* Show but disable unavailable auth methods

* make signup button consistent with others

* Always reload page on switch

* refine account switch styling

* logout barrier

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: k00b <k00b@stacker.news>
2024-09-12 13:05:11 -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 058f88da49 add halving to price carousel 2024-04-16 17:58:26 -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
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
st4rgut24 e9a5d22a6e
Add chain fees to price carousel (#658)
* add chain fees to price carousel

* restore check for valid carousel values

* add nym to contributors

---------

Co-authored-by: stargut <stargut@starguts-MacBook-Pro.local>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-12-20 16:06:22 -06:00
keyan af59e3ef54 merge non-normalized user subtypes fixing #645 2023-11-20 09:05:02 -06:00
st4rgut24 d84c46df81
Dont display price component until after initial render (#637)
* Dont display price component until after initial render

* change variable name and remove log

* fix linting issues

---------

Co-authored-by: stargut <stargut@starguts-MBP.fios-router.home>
Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
Co-authored-by: keyan <keyan.kousha+huumn@gmail.com>
2023-11-19 15:01:12 -06:00
SatsAllDay 64a16373c5
Fix client-side error boundary (#623)
* * add error boundary immediately above page component

* send error logs to server via LoggerContext

* display error stack and component stack in copyable text area

* wrap every context provider in an error boundary

* memoize context values to fix error boundary propagation issue

* Wrap page component in an error boundary so we can use our context utilities
for a better experience, like toast and logger

Still have a top-level error boundary that catches things from the context providers,
just in case.

Don't display the whole error stack, just because it's ugly, but make it copyable
2023-11-19 14:24:56 -06:00
keyan 52d938a22a remove block from blockheight 2023-09-12 16:36:26 -05:00
SatsAllDay 16a6f93708
Add block height to price carousel (#484)
* Add block height to price carousel

source block height from mempool.space API
https://mempool.space/docs/api/rest#get-block-tip-height

* Add block height to SSR, clean up fragment query

* Cache block height for 1 minute, not 30 seconds

use `numWithUnits` for block height label

* Replace mempool.space API with LND API call

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2023-09-12 10:56:02 -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 ab2046ab0b fix issues with new linting 2023-07-25 09:14:45 -05:00
keyan 59f7b6ff26 Revert "Revert "shield your eyes; massive, squashed refactor; nextjs/react/react-dom/apollo upgrades""
This reverts commit 18910fa2ed.
2023-07-23 10:08:43 -05:00
keyan 18910fa2ed Revert "shield your eyes; massive, squashed refactor; nextjs/react/react-dom/apollo upgrades"
This reverts commit d0314ab73c.
2023-07-23 09:16:12 -05:00
keyan d0314ab73c shield your eyes; massive, squashed refactor; nextjs/react/react-dom/apollo upgrades 2023-07-21 17:33:11 -05:00
keyan a241d683d8 nostr sub 2023-05-01 15:58:30 -05:00
keyan ff34bd0124 don't show price on error 2023-03-04 12:16:50 -06:00
keyan 4cae1ae230 reuse validation on server 2023-02-08 13:39:53 -06:00
keyan 816361bd96 remove semicolons from last merge 2023-01-27 18:08:58 -06:00
ekzyis 4ab66a67ae
Add proxy with cache for coinbase API requests (#226) 2023-01-27 17:20:33 -06:00
keyan c2685a659e sign up buttons 2023-01-09 18:33:44 -06:00
ekzyis 51db3b0142 Add ZAR currency 2022-10-21 16:28:49 +02:00
keyan 729bcead69 select instead of dropdown for currency 2022-10-04 16:21:42 -05:00
ekzyis 464281c0e1 Add AUD, CAD, GBP, NZD 2022-09-18 03:54:13 +02:00
ekzyis 22e07a4318 Fix errors if me null 2022-09-18 03:07:14 +02:00
ekzyis 6f632ccc0d Implement dynamic coinbase endpoint 2022-09-13 02:03:26 +02:00
keyan 82280b0966 add polls 2022-07-30 08:51:04 -05:00
keyan fde8937098 add onion address 2022-07-12 11:40:44 -05:00
keyan a7a72f0d2d improve navbar on mobile 2022-03-08 14:51:06 -06:00
keyan 1a3fdda382 new bolt 2021-12-05 11:37:55 -06:00
keyan c7ae5dc8ac ssr me and price 2021-11-28 11:29:17 -06:00
keyan dd97710d71 many small design enhancements 2021-11-12 16:39:52 -06:00
keyan 749b49c313 preload font, only show header items when they're done loading 2021-11-11 16:14:42 -06:00
keyan 31399c7547 fix crash when coinbase api goes down 2021-06-17 13:51:55 -05:00
keyan 764a683500 fix mobile input zoom issue 2021-05-06 17:01:48 -05:00
keyan 057bb0f10a localstorage price as sats 2021-04-29 13:43:17 -05:00
keyan f7b92d64c3 improve resolver and provide sats/$ 2021-04-29 10:56:28 -05:00
keyan 6ea9ff7e11 a number of style updates 2021-04-28 14:30:14 -05:00
keyan 9acde2df1c a bunch of increments 2021-04-12 13:05:09 -05:00