-
Notifications
You must be signed in to change notification settings - Fork 7
Process prefilled cashu link for wallet credit #91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Process prefilled cashu link for wallet credit #91
Conversation
Co-authored-by: db2002dominic <[email protected]>
|
Cursor Agent can help with this pull request. Just |
Deploying routstr-chat with
|
| Latest commit: |
03952eb
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://98a5697f.routstr-chat.pages.dev |
| Branch Preview URL: | https://cursor-process-prefilled-cas.routstr-chat.pages.dev |
| if (!topupFromUrl) return; | ||
| try { | ||
| localStorage.setItem('prefilled_topup_token', topupFromUrl); | ||
| } catch {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we log the error instead of silently catching?
| let token: string | null = null; | ||
| try { | ||
| token = localStorage.getItem('prefilled_topup_token'); | ||
| } catch {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we log the error instead of silently catching?
| if (!token) return; | ||
|
|
||
| processingTopupRef.current = true; | ||
| (async () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Without awaiting here, errors may not surface properly.
| await receiveToken(token as string); | ||
| try { localStorage.removeItem('prefilled_topup_token'); } catch {} | ||
| } catch (err) { | ||
| console.error('Failed to process prefilled topup token:', err); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should provide user feedback when token processing fails, not just console.error
Implement automatic crediting of Cashu tokens from
?topupURL parameters to support pre-filled topup links for new and existing users (fixes #90).