-
Notifications
You must be signed in to change notification settings - Fork 292
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(sto-bro): fix conditional value provided to FoldersMessageProvider #6112
fix(sto-bro): fix conditional value provided to FoldersMessageProvider #6112
Conversation
|
const Context = React.createContext<ContextType | undefined>(defaultValue); | ||
Context.displayName = contextDisplayName; |
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.
Provides a display name for the context in dev tools
getFolderSelectedMessage: (key: string) => { | ||
return `Current folder selected: ${key}. There are no additional folders under this path.`; | ||
}, |
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.
Unused
const foldersMessage = !hasFoldersInitialized | ||
? undefined | ||
: getListFoldersResultsMessage({ | ||
hasError: hasFoldersError, | ||
message: foldersErrorMessage, | ||
folders: pageItems, | ||
query, | ||
}); |
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.
Conditionally returning undefined
here was the root cause of the memo issue, moved the call to getListFoldersResultsMessage
itself inside FoldersMessageControl
and removed the init flag
@@ -96,6 +96,7 @@ export function DropdownMenu({ | |||
icon={icon} | |||
label={label} | |||
onClick={() => { | |||
setIsOpen(false); |
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.
Addresses a regression in the ActionsList composable migration, the menu was not closing on item select in composed StorageBrowser usage
Description of changes
Remove conditionally
undefined
value fromprops
provided toFoldersMessageProvider
Issue #, if available
Description of how you validated changes
Checklist
yarn test
passes and tests are updated/addeddocs
,e2e
,examples
, or other private packages.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.