-
Notifications
You must be signed in to change notification settings - Fork 107
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
Fixes/issue#388 #393
base: main
Are you sure you want to change the base?
Fixes/issue#388 #393
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
@VishalRpR is attempting to deploy a commit to the PearAI Team on Vercel. A member of the Team first needs to authorize it. |
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.
❌ Changes requested. Reviewed everything up to 19576d2 in 1 minute and 36 seconds
More details
- Looked at
120
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. components/dashboard/success-card.tsx:22
- Draft comment:
EnsureopenAppQueryParams
is a string before concatenating it withDEFAULT_OPEN_APP_CALLBACK
. If it's aURLSearchParams
, convert it to a string first. - Reason this comment was not posted:
Comment did not seem useful.
2. components/dashboard/success-card.tsx:27
- Draft comment:
EnsureisAllowedUrl
function is robust and correctly identifies unsafe URLs. Review its implementation if necessary. - Reason this comment was not posted:
Comment did not seem useful.
Workflow ID: wflow_vtnLJ3OmtN4jHJw3
Want Ellipsis to fix these issues? Tag @ellipsis-dev
in a comment. You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
import { isAllowedUrl } from "@/lib/utils"; | ||
import { toast } from "sonner"; | ||
|
||
const DEFAULT_OPEN_APP_CALLBACK = "pearai://pearai.pearai/auth"; |
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.
This constant is duplicated. Consider defining it in a shared constants file and importing it where needed.
- constant
DEFAULT_OPEN_APP_CALLBACK
(freetrial-card.tsx)
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.
Let's reuse existing variable
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.
The changes you made seems to only call this callback open functionality for subscription upgrades. We want this for when the user purchases a subscription, not just for upgrades.
import { isAllowedUrl } from "@/lib/utils"; | ||
import { toast } from "sonner"; | ||
|
||
const DEFAULT_OPEN_APP_CALLBACK = "pearai://pearai.pearai/auth"; |
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.
Let's reuse existing variable
@Fryingpannn looking into it! |
Description
When user subscribes, on the success page, call the same function as when they click "Open App" in their dashboard, so the app has the updated JWT
Related Issue
#388
Changes Made
Abstracted the Successpage as client side conponent and called the funtion for open App when user reaches success page on dashboard
Screenshots
Checklist
yarn build
and build is successfulImportant
Abstracts success page into
SuccessCard
component and updates JWT on subscription success by callingopenApp
.SuccessCard
component insuccess-card.tsx
.openApp
function on subscription success to update JWT.openApp
inSuccessCard
constructs callback URL and navigates usingrouter.push()
.toast.error()
if URL is unsafe or navigation fails.getUserAndSubscription
used inDashboardSuccess
to fetch query params for app opening.This description was created by for 19576d2. It will automatically update as commits are pushed.