Commit Graph

1164 Commits

Author SHA1 Message Date
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
ekzyis 85a8fc5dcd
Fix different slugs generated in ToC vs text (#1405) 2024-09-13 15:54:30 -05:00
ekzyis c8975038bd
Never update author of item on edit (#1401)
* Never update author of item on edit

* Only show option to edit via hmac if anonymous

* Only send hash+hmac if anonymous
2024-09-13 11:19:54 -05:00
ekzyis 30d5eb9801
Catch s3 upload errors (#1400)
* Catch s3 upload errors

* Include file name in error message

* More renaming from image to file
2024-09-13 10:41:07 -05:00
k00b e09e1398fd increase upload max and update error messages 2024-09-13 10:13:34 -05:00
ekzyis 8a4e67e9f0
Anon edits (#1393)
* Rename vars around edit permission

* Allow anon edits with hash+hmac

* Fix missing time zone for invoice.confirmedAt of comments

* Fix missing invoice update on item update

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2024-09-13 10:11:19 -05:00
ekzyis 4340a82a62
Allow video uploads (#1399)
* Allow video uploads

* fix video preview

---------

Co-authored-by: k00b <k00b@stacker.news>
2024-09-13 09:26:08 -05:00
k00b b3d9eb0eba fix media grid with newlines in same p tag 2024-09-12 16:44:05 -05:00
ekzyis 24aacd8839
Fix recv wallet deleted on logout (#1398)
* Fix recv wallet deleted on logout

* Fix wallet logs on server deleted on logout

* Remove unused option in deleteLogs to override wallet
2024-09-12 13:06:13 -05:00
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
Keyan fe0678b4cb
css to put adjacent images/video into vertical alignment (#1387)
* css to put adjacent images/video into vertical alignment

* fix grids chrome

* even grid gap with safari support

* fixes for video and horizontal scroll
2024-09-11 20:10:52 -05:00
k00b da2fabc95c fix embed styling 2024-09-11 11:10:21 -05:00
ekzyis ec5241ad29
Enable WebLN wallet on 'webln:enabled' (#1385)
* Enable WebLN wallet on 'webln:enabled'

* Optimistically use WebLN for login with lightning

* Don't scope WebLN config to user

* Rename var to wallet
2024-09-10 11:13:39 -05:00
ekzyis 2ad2cabb03
Remove overused fw-bold from infos (#1377) 2024-09-08 16:53:13 -05:00
ekzyis 1822b3fe42
Fix embeds (#1375)
* Fix wavlake embed

* Fix invalid DOM property

* Fix iframe message not received

* Fix spotify embed controller and popups

* Allow popups to escape sandbox
2024-09-08 10:32:35 -05:00
k00b 62556d2154 fix multiple nostr embed race and link clicks 2024-09-07 19:45:37 -05:00
Keyan 15b038cd78
refactor embeds to be reused (#1368)
* refactor embeds to be reused

* adjust the meaning of settings for embeds

* add wavlake embed (close #1359)

* add spotify embed (closes #1360)

* fix 'format' appearing in srcSet

* add nostr embed

* refine nostr embed

* Update components/media-or-link.js

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

* Update pages/settings/index.js

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

* ek suggestions

---------

Co-authored-by: ekzyis <ek@stacker.news>
2024-09-07 12:07:10 -05:00
ekzyis 54f8a61483
Random CSS fixes (#1370)
* Fix missing margin-left for invoice status in /satistics

* Fix margin-bottom not applied in invoice info

* Only apply margin-left if there is something left
2024-09-07 10:01:00 -05:00
Keyan 2f546facb2
get dimensions for video and refactor images (#1366)
* get dimensions for video and refactor images

* improve rendering performance

* more rendering perf enhancements
2024-09-06 09:34:44 -05:00
k00b fe717e0169 fix image/video clicks in notifications 2024-09-04 13:36:56 -05:00
k00b 1cc897a7a3 don't enforce min-width on videos 2024-09-04 11:00:54 -05:00
Keyan 07b98c3253
Optout of display of images and video (show them as links) (#1358)
* optout of display of images/video

* fix disableFreebies warning in settings

* preview trusted images

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

---------

Co-authored-by: ekzyis <ek@stacker.news>
2024-09-04 09:23:06 -05:00
Keyan 6f68a700ce
recognize video links (#1357) 2024-09-03 18:35:14 -05:00
Keyan adcf048f4e
improve dupes (#1356) 2024-09-03 14:29:45 -05:00
ekzyis d9024ff837
Reinitialize wallet form if initial values change + fix readOnly hydration error (#1354)
* Reinitialize wallet form if initial values change

This fixes that enabled is not set on first render if only recv is configured

* Remove unnecessary old usage of ClientCheckbox

This isn't needed even without enableReinitialize since for send, enabled is correctly set on first render.

It was needed in the past when we were still validating wallets before enabling them on first page load but now, we simply load the configuration from localStorage which is immediately available on the client.

* Fix readOnly hydration error

* Replace repetitive isMounted logic with useIsClient hook
2024-09-03 09:15:04 -05:00
k00b 69916117b1 refine popover close timing 2024-09-02 18:25:02 -05:00
k00b 67799a508a image loading fixes (fixes #1345) 2024-09-02 18:15:21 -05:00
ekzyis 07ebc60bc3
Use undefined instead of empty function for onHide (#1348) 2024-09-02 12:57:16 -05:00
ekzyis c43a171794
Fix onHide is not a function (#1347) 2024-09-02 09:33:17 -05:00
ekzyis 2503a3cb6a
Update wallet security banner (#1338)
* fix condition
* update text
2024-08-27 17:16:41 -05:00
Keyan 266e9a892d
Improve freebies (#1333)
* remove free posts

* deleted and freebie comments are always last
2024-08-26 19:23:07 -05:00
k00b 5cfefc1ca8 cancelled failed payment if not showing qr 2024-08-26 13:58:37 -05:00
k00b 5ae3084e53 remove defunct chats from footer 2024-08-26 12:59:39 -05:00
ekzyis 82788b35bf
Show item details via context menu (#1325)
* Show item details via context

* Use zappers instead of upvotes

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

---------

Co-authored-by: Keyan <34140557+huumn@users.noreply.github.com>
2024-08-21 20:35:13 -05:00
k00b c4a96af5d3 fix crossposting toast 2024-08-21 14:59:28 -05:00
Keyan bc94ec7d28
disable freebies setting (#1320)
* disable freebies setting

* await in disableFreebie resolver + better info modal
2024-08-21 09:37:25 -05:00
Tom 4fd23a3694
Add Random link and basic query (#1306)
* Add Random link and basic query

* Use random

* refine random sort query

* make vote threshold higher

---------

Co-authored-by: k00b <k00b@stacker.news>
2024-08-20 16:50:55 -05:00
ekzyis 06b661625c
Use custom relay API (#1302)
* Use custom relay API

Relay from nostr-tools was cumbersome to use. This custom abstraction over window.WebSocket makes interacting with nostr relays easier.

* Use variables for nostr message parts

* Fix NWC save

* Use try/finally

* Refactor crossposting code

* use custom replay API
* simplify callWithTimeout

* Use isomorphic-ws for nip57 zap receipts

* Use async map

* Reject with timeout error

* Move time functions into lib/time

* Remove outdated comment regarding relay.close()
2024-08-18 17:28:39 -05:00
ekzyis 3cd9991aa9
Hide wallet name in logs for only a single wallet (#1305) 2024-08-16 09:02:09 -05:00
ekzyis 4000522773
Fix WebLN checkbox unclickable (#1299)
Checkbox was unclickable because wallet.isConfigured is false if wallet.config was null.
2024-08-14 14:29:24 -05:00
k00b ac87322ac8 fix user/item popover 2024-08-13 15:30:43 -05:00