mirror of
https://github.com/block/buzz.git
synced 2026-11-04 16:31:38 +00:00
fix(desktop): key-based React remount for workspace switching (#415)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -19,10 +19,14 @@ type MessageThreadPanelProps = {
|
||||
channelName: string;
|
||||
currentPubkey?: string;
|
||||
disabled?: boolean;
|
||||
editTarget?: { author: string; body: string; id: string } | null;
|
||||
isSending: boolean;
|
||||
onCancelEdit?: () => void;
|
||||
onCancelReply: () => void;
|
||||
onClose: () => void;
|
||||
onDelete?: (message: TimelineMessage) => void;
|
||||
onEdit?: (message: TimelineMessage) => void;
|
||||
onEditSave?: (content: string) => Promise<void>;
|
||||
onExpandReplies: (message: TimelineMessage) => void;
|
||||
onResetWidth: () => void;
|
||||
onResizeStart: (event: React.PointerEvent<HTMLButtonElement>) => void;
|
||||
@@ -66,10 +70,14 @@ export function MessageThreadPanel({
|
||||
channelName,
|
||||
currentPubkey,
|
||||
disabled = false,
|
||||
editTarget,
|
||||
isSending,
|
||||
onCancelEdit,
|
||||
onCancelReply,
|
||||
onClose,
|
||||
onDelete,
|
||||
onEdit,
|
||||
onEditSave,
|
||||
onExpandReplies,
|
||||
onResetWidth,
|
||||
onResizeStart,
|
||||
@@ -179,6 +187,11 @@ export function MessageThreadPanel({
|
||||
? onDelete
|
||||
: undefined
|
||||
}
|
||||
onEdit={
|
||||
onEdit && canManageMessage(threadHead, currentPubkey)
|
||||
? onEdit
|
||||
: undefined
|
||||
}
|
||||
onToggleReaction={onToggleReaction}
|
||||
profiles={profiles}
|
||||
/>
|
||||
@@ -205,6 +218,12 @@ export function MessageThreadPanel({
|
||||
? onDelete
|
||||
: undefined
|
||||
}
|
||||
onEdit={
|
||||
onEdit &&
|
||||
canManageMessage(entry.message, currentPubkey)
|
||||
? onEdit
|
||||
: undefined
|
||||
}
|
||||
onReply={onSelectReplyTarget}
|
||||
onToggleReaction={onToggleReaction}
|
||||
profiles={profiles}
|
||||
@@ -259,8 +278,11 @@ export function MessageThreadPanel({
|
||||
channelName={channelName}
|
||||
disabled={disabled || isSending || !channelId}
|
||||
draftKey={`thread:${threadHead.id}`}
|
||||
editTarget={editTarget}
|
||||
isSending={isSending}
|
||||
onCancelEdit={onCancelEdit}
|
||||
onCancelReply={composerReplyTarget ? onCancelReply : undefined}
|
||||
onEditSave={onEditSave}
|
||||
onSend={onSend}
|
||||
placeholder={`Reply in thread to ${threadHead.author}`}
|
||||
replyTarget={composerReplyTarget}
|
||||
|
||||
Reference in New Issue
Block a user