stories: fix module cycle
This commit is contained in:
parent
42362a2772
commit
32a8a0161d
2 changed files with 24 additions and 23 deletions
|
@ -37,7 +37,6 @@ import {
|
|||
asyncShouldNeverBeCalled,
|
||||
} from '../util/shouldNeverBeCalled';
|
||||
import { useConfirmDiscard } from '../hooks/useConfirmDiscard';
|
||||
import { getListViewers } from './SendStoryModal';
|
||||
|
||||
export type PropsType = {
|
||||
candidateConversations: Array<ConversationType>;
|
||||
|
@ -94,6 +93,22 @@ const modalCommonProps: Pick<ModalPropsType, 'hasXButton' | 'moduleClassName'> =
|
|||
moduleClassName: 'StoriesSettingsModal__modal',
|
||||
};
|
||||
|
||||
export function getListViewers(
|
||||
list: StoryDistributionListWithMembersDataType,
|
||||
i18n: LocalizerType,
|
||||
signalConnections: Array<ConversationType>
|
||||
): string {
|
||||
let memberCount = list.members.length;
|
||||
|
||||
if (list.id === MY_STORIES_ID && list.isBlockList) {
|
||||
memberCount = list.isBlockList
|
||||
? signalConnections.length - list.members.length
|
||||
: signalConnections.length;
|
||||
}
|
||||
|
||||
return i18n('icu:StoriesSettings__viewers', { count: memberCount });
|
||||
}
|
||||
|
||||
type DistributionListItemProps = {
|
||||
i18n: LocalizerType;
|
||||
distributionList: StoryDistributionListWithMembersDataType;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue