Skip to content

Commit 06c7787

Browse files
Revert "fix: address PR review - ChatInput event type, userId fallback, contentParsing docstring"
This reverts commit f6722be.
1 parent f6722be commit 06c7787

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

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

46-
const handleSubmit = useCallback(() => {
46+
const handleSubmit = useCallback((e: React.FormEvent) => {
47+
e.preventDefault();
4748
if (inputValue.trim() && !disabled) {
4849
onSendMessage(inputValue.trim());
4950
setInputValue('');
@@ -53,7 +54,7 @@ export const ChatInput = memo(function ChatInput({
5354
const handleKeyDown = useCallback((e: React.KeyboardEvent) => {
5455
if (e.key === 'Enter' && !e.shiftKey) {
5556
e.preventDefault();
56-
handleSubmit();
57+
handleSubmit(e);
5758
}
5859
}, [handleSubmit]);
5960

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` when restoring from a saved
65-
* conversation; `false` (default) when the response just came from the live API.
64+
* Pass `rewriteBlobs: true` (default) when restoring from a saved
65+
* conversation; `false` 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)