-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
fix(design-system): singleton prompt #11352
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
6 Skipped Deployments
|
const prompt = async (props: UsePromptProps): Promise<boolean> => { | ||
if (singleton && flag.current) { |
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.
LGTM, but should we perhaps just change it so this is the default behaviour, without needing to do singleton: true
? I can't really come up with any cases where you would ever want to render multiple prompts since they stack on top of each other, making everyone except the top one visible.
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.
Yup, makes more sense for this to be the default. Will push a change.
# Conflicts: # packages/admin/dashboard/src/routes/api-key-management/api-key-management-detail/components/api-key-sales-channel-section/api-key-sales-channel-section.tsx
let open = true | ||
if (isPromptActive.current) { | ||
// If the prompt is already active, return the current promise | ||
return currentPromptPromise.current! |
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.
Instead of returning false
we return the active promise if prompt
is called again while the prompt is already active.
What
Why
CLOSES SUP-802