Skip to content

Commit f6722be

Browse files
fix: address PR review - ChatInput event type, userId fallback, contentParsing docstring
1 parent b9b95ef commit f6722be

3 files changed

Lines changed: 5 additions & 6 deletions

File tree

src/App/src/api/httpClient.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ httpClient.onRequest(async (_url, init) => {
178178
try {
179179
const { store } = await import('../store/store');
180180
const state = store?.getState?.();
181-
const userId: string = state?.app?.userId ?? 'anonymous';
181+
const userId: string = state?.app?.userId || 'anonymous';
182182
headers.set('X-Ms-Client-Principal-Id', userId);
183183
} catch {
184184
headers.set('X-Ms-Client-Principal-Id', 'anonymous');

src/App/src/components/ChatInput.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,7 @@ export const ChatInput = memo(function ChatInput({
4343
if (controlledValue === undefined) setInternalValue(v);
4444
}, [controlledOnChange, controlledValue]);
4545

46-
const handleSubmit = useCallback((e: React.FormEvent) => {
47-
e.preventDefault();
46+
const handleSubmit = useCallback(() => {
4847
if (inputValue.trim() && !disabled) {
4948
onSendMessage(inputValue.trim());
5049
setInputValue('');
@@ -54,7 +53,7 @@ export const ChatInput = memo(function ChatInput({
5453
const handleKeyDown = useCallback((e: React.KeyboardEvent) => {
5554
if (e.key === 'Enter' && !e.shiftKey) {
5655
e.preventDefault();
57-
handleSubmit(e);
56+
handleSubmit();
5857
}
5958
}, [handleSubmit]);
6059

src/App/src/utils/contentParsing.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@ function parseTextContent(
6161
* Resolve the best available image URL from a raw API response.
6262
*
6363
* Priority: explicit `image_url` (with blob rewrite) → base64 data URI.
64-
* Pass `rewriteBlobs: true` (default) when restoring from a saved
65-
* conversation; `false` when the response just came from the live API.
64+
* Pass `rewriteBlobs: true` when restoring from a saved
65+
* conversation; `false` (default) when the response just came from the live API.
6666
*/
6767
function resolveImageUrl(
6868
raw: { image_url?: string; image_base64?: string },

0 commit comments

Comments
 (0)