diff --git a/src/common/UnreadCount.js b/src/common/UnreadCount.js index 101b22de35e..52226e62900 100644 --- a/src/common/UnreadCount.js +++ b/src/common/UnreadCount.js @@ -4,7 +4,6 @@ import { StyleSheet, Text, View } from 'react-native'; import type { ViewStyleProp } from 'react-native/Libraries/StyleSheet/StyleSheet'; import { BRAND_COLOR } from '../styles'; -import { unreadToLimitedCount } from '../utils/unread'; import { foregroundColorFromBackground } from '../utils/color'; const styles = StyleSheet.create({ @@ -83,10 +82,11 @@ export default class UnreadCount extends PureComponent { const textColor = foregroundColorFromBackground(color); const textStyle = [styles.text, inverse && styles.textInverse, { color: textColor }]; + const countString = limited && count >= 100 ? '99+' : count.toString(); return ( - {limited ? unreadToLimitedCount(count) : count} + {countString} ); diff --git a/src/utils/unread.js b/src/utils/unread.js index 018cf0ed27e..d794ae2729d 100644 --- a/src/utils/unread.js +++ b/src/utils/unread.js @@ -15,6 +15,3 @@ export const filterUnreadMessagesInRange = ( .filter(msg => msg.id >= fromId && msg.id <= toId); return filterUnreadMessageIds(messagesInRange.map(x => x.id), flags); }; - -export const unreadToLimitedCount = (count: number): string => - count < 100 ? count.toString() : '99+';