From c4c4674e0e6ac4410bb920f572ddef43318d66bd Mon Sep 17 00:00:00 2001 From: cballevre Date: Wed, 20 Nov 2024 10:41:12 +0100 Subject: [PATCH] fix(ShortcutLink): Using a flag instead of a context --- src/components/ShortcutLink.jsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/components/ShortcutLink.jsx b/src/components/ShortcutLink.jsx index 9b0c11db7..b91183ce0 100644 --- a/src/components/ShortcutLink.jsx +++ b/src/components/ShortcutLink.jsx @@ -1,8 +1,9 @@ import React from 'react' import get from 'lodash/get' -import { useClient, useFetchShortcut, useInstanceInfo } from 'cozy-client' +import { useClient, useFetchShortcut } from 'cozy-client' import { CozyFile } from 'cozy-doctypes' +import flag from 'cozy-flags' import SquareAppIcon from 'cozy-ui/transpiled/react/SquareAppIcon' import Link from 'cozy-ui/transpiled/react/Link' @@ -22,7 +23,6 @@ export const ShortcutLink = ({ // waiting an http request to resolve. const { shortcutInfos } = useFetchShortcut(client, file._id) const { isMobile } = useBreakpoints() - const instanceInfo = useInstanceInfo() const computedSize = isMobile ? 32 : desktopSize const { filename } = CozyFile.splitFilename(file) @@ -35,8 +35,6 @@ export const ShortcutLink = ({ const icon = get(file, 'attributes.metadata.icon') const iconMimeType = get(file, 'attributes.metadata.iconMimeType') const description = get(file, 'attributes.metadata.description') - const shouldShortcutBadgeHidden = - instanceInfo.context?.data?.hide_shortcut_badge_on_home ?? false return ( } - hideShortcutBadge={shouldShortcutBadgeHidden} + hideShortcutBadge={flag('home.hide-shortcut-badge')} /> ) : ( )}