Skip to content

Commit

Permalink
fix: do not show latest version if auto-updating (#7388)
Browse files Browse the repository at this point in the history
  • Loading branch information
cngonzalez authored Aug 20, 2024
1 parent 87316d6 commit 1872388
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import {Box, MenuDivider, Text} from '@sanity/ui'

import {MenuItem} from '../../../../../ui-components'
import {LoadingBlock} from '../../../../components/loadingBlock'
import {hasSanityPackageInImportMap} from '../../../../environment/hasSanityPackageInImportMap'
import {useTranslation} from '../../../../i18n'
import {SANITY_VERSION} from '../../../../version'
import {type ResourcesResponse, type Section} from './helper-functions/types'
Expand All @@ -15,6 +16,7 @@ interface ResourcesMenuItemProps {
export function ResourcesMenuItems({error, isLoading, value}: ResourcesMenuItemProps) {
const sections = value?.resources?.sectionArray
const latestStudioVersion = value?.latestVersion
const isAutoUpdating = hasSanityPackageInImportMap()
const {t} = useTranslation()

if (isLoading) {
Expand Down Expand Up @@ -61,7 +63,7 @@ export function ResourcesMenuItems({error, isLoading, value}: ResourcesMenuItemP
<Text size={1} muted weight="medium" textOverflow="ellipsis">
{t('help-resources.studio-version', {studioVersion: SANITY_VERSION})}
</Text>
{!error && latestStudioVersion && (
{!error && latestStudioVersion && !isAutoUpdating && (
<Box paddingTop={2}>
<Text size={1} muted textOverflow="ellipsis">
{t('help-resources.latest-sanity-version', {
Expand Down

0 comments on commit 1872388

Please sign in to comment.