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: Sharing banner blinks #3259

Merged
merged 1 commit into from
Dec 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions src/modules/views/Public/PublicFolderView.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,16 +161,15 @@ const PublicFolderView = () => {
!showNewBreadcrumbFlag || showNewBreadcrumbFlag !== true

// Check if the sharing shortcut has already been created (but not synced)
const isShareAlreadyAdded =
!sharingInfos.loading && sharingInfos.isSharingShortcutCreated
const isShareNotAdded =
!sharingInfos.loading && !sharingInfos.isSharingShortcutCreated
// Check if you are sharing Cozy to Cozy (Link sharing is on the `/public` route)
const isPreview = window.location.pathname === '/preview'
// Show the sharing banner plugin only on shared links view and cozy to cozy sharing view(not added)
const isSharingBannerPluginDisplayed =
!isShareAlreadyAdded || (isOnSharedFolder && !isPreview)
isShareNotAdded || (isOnSharedFolder && !isPreview)

const isAddToMyCozyFabDisplayed =
isMobile && isPreview && !isShareAlreadyAdded
const isAddToMyCozyFabDisplayed = isMobile && isPreview && isShareNotAdded

return (
<Main isPublic={true}>
Expand Down
Loading