Skip to content

Commit

Permalink
fix(suite): Dont show update banner until discovery is finished (#16602)
Browse files Browse the repository at this point in the history
  • Loading branch information
jvaclavik authored Jan 30, 2025
1 parent 313c85a commit 26803f8
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import {
mapDeviceUpdateToClick,
} from './updateQuickActionTypes';
import { Translation, TranslationKey } from '../../../../../Translation';
import { useDispatch } from '../../../../../../../hooks/suite';
import { useDiscovery, useDispatch } from '../../../../../../../hooks/suite';

type ContainerProps = { $elevation: Elevation };

Expand Down Expand Up @@ -77,6 +77,9 @@ export const UpdateNotificationBanner = ({
onClose,
}: UpdateNotificationBannerProps) => {
const dispatch = useDispatch();
const { getDiscoveryStatus } = useDiscovery();
const discoveryStatus = getDiscoveryStatus();
const discoveryInProgress = discoveryStatus && discoveryStatus.status === 'loading';

const translationHeader =
updateStatusSuite !== 'up-to-date' // Update suite first, because it will contain the newest firmware
Expand All @@ -88,7 +91,7 @@ export const UpdateNotificationBanner = ({
updateStatusSuite !== 'up-to-date' ? updateStatusSuite : updateStatusDevice
];

if (translationHeader === null || translationCallToAction === null) {
if (translationHeader === null || translationCallToAction === null || discoveryInProgress) {
return null;
}

Expand Down

0 comments on commit 26803f8

Please sign in to comment.