Files
Desktop/ts/util/startConversation.dom.ts
Fedor Indutny 44076ece79 Rename files
2025-10-16 23:45:44 -07:00

25 lines
637 B
TypeScript

// Copyright 2022 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import type { ServiceIdString } from '../types/ServiceId.std.js';
import { strictAssert } from './assert.std.js';
export function startConversation(
e164: string,
serviceId: ServiceIdString
): void {
const conversation = window.ConversationController.lookupOrCreate({
e164,
serviceId,
reason: 'util/startConversation',
});
strictAssert(
conversation,
`startConversation failed given ${e164}/${serviceId} combination`
);
window.reduxActions.conversations.showConversation({
conversationId: conversation.id,
});
}