Skip to content

Commit

Permalink
fix: conditionally executed hook (DSN-000) (#298)
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaalnaik authored Nov 12, 2024
1 parent 5731f12 commit fc60962
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/chat/src/views/ChatWindow/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ export const ChatWindow: React.FC<ChatWindowProps> = ({ isMobile }) => {
runtime.stopChat();
}, []);

if (!palette) return null;

// TODO: We'll need this for feedback probably
const getPreviousUserTurn = useCallback(
(turnIndex: number): UserTurnProps | null => {
Expand All @@ -45,6 +43,8 @@ export const ChatWindow: React.FC<ChatWindowProps> = ({ isMobile }) => {
[state.session.turns]
);

if (!palette) return null;

return (
<div style={assignInlineVars(PALETTE, { colors: palette })} className={chatWindow}>
<NewChat
Expand Down

0 comments on commit fc60962

Please sign in to comment.