Skip to content

Commit 34ee83f

Browse files
fix: ItemStatusBadge not updating correctly (#3169)
1 parent 65d55f4 commit 34ee83f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/components/ItemStatusBadge/ItemStatusBadge.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const ItemStatusBadge = (props: Props) => {
2929
case SyncStatus.UNPUBLISHED:
3030
return <Icon name="cloud upload" />
3131
}
32-
}, [status])
32+
}, [status, isMappingMissingFromItem, isMappingNotPublished])
3333

3434
const text = useMemo(() => {
3535
if (isMappingMissingFromItem) {
@@ -38,16 +38,16 @@ export const ItemStatusBadge = (props: Props) => {
3838
return t('item_status.pending_migration')
3939
}
4040
return t(`item_status.${status}`)
41-
}, [status])
41+
}, [status, isMappingMissingFromItem, isMappingNotPublished])
4242

4343
const style = useMemo(() => {
44-
if (!item.mappings) {
44+
if (isMappingMissingFromItem) {
4545
return 'pending_mapping'
4646
} else if (isMappingNotPublished) {
4747
return 'pending_migration'
4848
}
4949
return status
50-
}, [status])
50+
}, [status, isMappingMissingFromItem, isMappingNotPublished])
5151

5252
return (
5353
<div className={classNames(styles[style], styles.status)}>

0 commit comments

Comments
 (0)