Introduce Service Id Types

Co-authored-by: Scott Nonnenberg <scott@signal.org>
This commit is contained in:
Fedor Indutny 2023-08-10 18:43:33 +02:00 committed by Jamie Kyle
parent 414c0a58d3
commit 366b875fd2
269 changed files with 5832 additions and 5550 deletions

View file

@ -2,6 +2,7 @@
// SPDX-License-Identifier: AGPL-3.0-only
import casual from 'casual';
import { v4 as generateUuid } from 'uuid';
import type { AttachmentType } from '../../types/Attachment';
import type { ConversationType } from '../../state/ducks/conversations';
@ -11,7 +12,6 @@ import type {
StoryViewType,
} from '../../types/Stories';
import * as durations from '../../util/durations';
import { UUID } from '../../types/UUID';
import { getDefaultConversation } from './getDefaultConversation';
import { fakeAttachment, fakeThumbnail } from './fakeAttachment';
import { MY_STORY_ID, ResolvedSendStatus } from '../../types/Stories';
@ -28,7 +28,7 @@ export function getFakeMyStory(id?: string, name?: string): MyStoryType {
const storyCount = casual.integer(2, 6);
return {
id: id || UUID.generate().toString(),
id: id || generateUuid(),
name: name || id === MY_STORY_ID ? 'My Stories' : casual.catch_phrase,
reducedSendStatus: ResolvedSendStatus.Sent,
stories: Array.from(Array(storyCount), () => ({
@ -45,7 +45,7 @@ export function getFakeStoryView(
): StoryViewType {
const sender = getDefaultConversation();
const messageId = UUID.generate().toString();
const messageId = generateUuid();
return {
attachment: getAttachmentWithThumbnail(