Files
Desktop/ts/shims/reloadSelectedConversation.dom.ts
2026-02-21 06:49:02 +10:00

24 lines
622 B
TypeScript

// Copyright 2021 Signal Messenger, LLC
// SPDX-License-Identifier: AGPL-3.0-only
import { getSelectedConversationId } from '../state/selectors/nav.std.js';
export function reloadSelectedConversation(): void {
const selectedConversationId = getSelectedConversationId(
window.reduxStore.getState()
);
if (!selectedConversationId) {
return;
}
const conversation = window.ConversationController.get(
selectedConversationId
);
if (!conversation) {
return;
}
conversation.cachedProps = undefined;
window.reduxActions.conversations.conversationsUpdated([
conversation.format(),
]);
}