mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 12:19:41 +00:00
Fix conversation view from getting stale data
This commit is contained in:
@@ -6,6 +6,7 @@ import type { LocalizerType } from '../types/I18N';
|
||||
import type { NavTabPanelProps } from './NavTabs';
|
||||
import { WhatsNewLink } from './WhatsNewLink';
|
||||
import type { UnreadStats } from '../util/countUnreadStats';
|
||||
import type { SmartConversationViewProps } from '../state/smart/ConversationView';
|
||||
|
||||
export type ChatsTabProps = Readonly<{
|
||||
otherTabsUnreadStats: UnreadStats;
|
||||
@@ -15,7 +16,7 @@ export type ChatsTabProps = Readonly<{
|
||||
hasFailedStorySends: boolean;
|
||||
navTabsCollapsed: boolean;
|
||||
onToggleNavTabsCollapse: (navTabsCollapsed: boolean) => void;
|
||||
renderConversationView: () => JSX.Element;
|
||||
renderConversationView: (props: SmartConversationViewProps) => JSX.Element;
|
||||
renderLeftPane: (props: NavTabPanelProps) => JSX.Element;
|
||||
renderMiniPlayer: (options: { shouldFlow: boolean }) => JSX.Element;
|
||||
selectedConversationId: string | undefined;
|
||||
@@ -51,10 +52,12 @@ export function ChatsTab({
|
||||
<div id="toast" />
|
||||
{selectedConversationId ? (
|
||||
<div
|
||||
// Use `key` to force the tree to fully re-mount
|
||||
key={selectedConversationId}
|
||||
className="Inbox__conversation"
|
||||
id={`conversation-${selectedConversationId}`}
|
||||
>
|
||||
{renderConversationView()}
|
||||
{renderConversationView({ selectedConversationId })}
|
||||
</div>
|
||||
) : (
|
||||
<div className="Inbox__no-conversation-open">
|
||||
|
||||
Reference in New Issue
Block a user