fix: show undo/redo buttons when server restart error occurs

This commit is contained in:
Developer
2026-02-15 12:50:56 +00:00
parent 6bcdb2b739
commit 04780632e8

View File

@@ -1984,7 +1984,8 @@ function renderMessages(session) {
const isOpencodeMsg = msg.cli === 'opencode' || msg.phase === 'build'; const isOpencodeMsg = msg.cli === 'opencode' || msg.phase === 'build';
const isLatestMessage = latestMessage && latestMessage.id === msg.id; const isLatestMessage = latestMessage && latestMessage.id === msg.id;
const shouldShowUndoRedo = isOpencodeMsg && isLatestMessage && (status === 'done' || status === 'error' || status === 'cancelled'); const isServerRestartError = msg.error === 'Server restart took too long. Please refresh and try again.';
const shouldShowUndoRedo = isLatestMessage && (status === 'done' || status === 'error' || status === 'cancelled') && (isOpencodeMsg || isServerRestartError);
const shouldRenderAssistantCard = msg.reply || msg.error || (status === 'running' && msg.partialOutput) || shouldShowUndoRedo; const shouldRenderAssistantCard = msg.reply || msg.error || (status === 'running' && msg.partialOutput) || shouldShowUndoRedo;
if (shouldRenderAssistantCard) { if (shouldRenderAssistantCard) {