2022-08-02 19:31:55 +00:00
|
|
|
// Copyright 2022 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import casual from 'casual';
|
|
|
|
|
|
|
|
import type { StoryDistributionListDataType } from '../../state/ducks/storyDistributionLists';
|
2022-08-30 19:13:32 +00:00
|
|
|
import type { StoryDistributionListWithMembersDataType } from '../../types/Stories';
|
2022-11-10 15:51:39 +00:00
|
|
|
import { MY_STORY_ID } from '../../types/Stories';
|
2023-08-10 16:43:33 +00:00
|
|
|
import { generateStoryDistributionId } from '../../types/StoryDistributionId';
|
|
|
|
import { generateAci } from '../../types/ServiceId';
|
2022-08-30 19:13:32 +00:00
|
|
|
import { getDefaultConversation } from './getDefaultConversation';
|
|
|
|
|
|
|
|
export function getFakeDistributionListsWithMembers(): Array<StoryDistributionListWithMembersDataType> {
|
|
|
|
return [
|
|
|
|
{
|
|
|
|
...getMyStories(),
|
|
|
|
members: [],
|
|
|
|
},
|
|
|
|
...Array.from(Array(casual.integer(2, 8)), () => ({
|
|
|
|
...getFakeDistributionList(),
|
|
|
|
members: Array.from(Array(casual.integer(3, 12)), () =>
|
|
|
|
getDefaultConversation()
|
|
|
|
),
|
|
|
|
})),
|
|
|
|
];
|
|
|
|
}
|
2022-08-02 19:31:55 +00:00
|
|
|
|
|
|
|
export function getFakeDistributionLists(): Array<StoryDistributionListDataType> {
|
|
|
|
return [
|
|
|
|
getMyStories(),
|
|
|
|
...Array.from(Array(casual.integer(2, 8)), getFakeDistributionList),
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getFakeDistributionList(): StoryDistributionListDataType {
|
|
|
|
return {
|
|
|
|
allowsReplies: Boolean(casual.coin_flip),
|
2023-08-10 16:43:33 +00:00
|
|
|
id: generateStoryDistributionId(),
|
2022-08-02 19:31:55 +00:00
|
|
|
isBlockList: false,
|
2023-08-10 16:43:33 +00:00
|
|
|
memberServiceIds: Array.from(Array(casual.integer(3, 12)), () =>
|
|
|
|
generateAci()
|
2022-08-02 19:31:55 +00:00
|
|
|
),
|
|
|
|
name: casual.title,
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
|
|
|
export function getMyStories(): StoryDistributionListDataType {
|
|
|
|
return {
|
|
|
|
allowsReplies: true,
|
2022-11-10 15:51:39 +00:00
|
|
|
id: MY_STORY_ID,
|
2022-08-02 19:31:55 +00:00
|
|
|
isBlockList: true,
|
2023-08-10 16:43:33 +00:00
|
|
|
memberServiceIds: [],
|
2022-11-10 15:51:39 +00:00
|
|
|
name: MY_STORY_ID,
|
2022-08-02 19:31:55 +00:00
|
|
|
};
|
|
|
|
}
|