Skip to content
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

Conversation

calebpollman
Copy link
Member

Description of changes

Remove conditionally undefined value from props provided to FoldersMessageProvider

Issue #, if available

Description of how you validated changes

Checklist

  • Have read the Pull Request Guidelines
  • PR description included
  • yarn test passes and tests are updated/added
  • PR title and commit messages follow conventional commit syntax
  • If this change should result in a version bump, changeset added (This can be done after creating the PR.) This does not apply to changes made to docs, 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.

@calebpollman calebpollman requested a review from a team as a code owner November 16, 2024 21:53
Copy link

changeset-bot bot commented Nov 16, 2024

⚠️ No Changeset found

Latest commit: 9cf100b

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

const Context = React.createContext<ContextType | undefined>(defaultValue);
Context.displayName = contextDisplayName;
Copy link
Member Author

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

Comment on lines -51 to -53
getFolderSelectedMessage: (key: string) => {
return `Current folder selected: ${key}. There are no additional folders under this path.`;
},
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unused

Comment on lines -92 to -99
const foldersMessage = !hasFoldersInitialized
? undefined
: getListFoldersResultsMessage({
hasError: hasFoldersError,
message: foldersErrorMessage,
folders: pageItems,
query,
});
Copy link
Member Author

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);
Copy link
Member Author

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

@calebpollman calebpollman merged commit 06431d9 into feat-storage-browser/main Nov 16, 2024
33 checks passed
@calebpollman calebpollman deleted the feat-storage-browser/fix-copy-view-memo-issue branch November 16, 2024 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants