mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-27 13:29:15 +07:00
🐛 fix: fix image prompt form (#9995)
* 🐛 fix: do not create image on Enter key during composition * 🐛 fix: include authorization header in mock user context
This commit is contained in:
@@ -73,7 +73,7 @@ const PromptInput = ({ showTitle = false }: PromptInputProps) => {
|
||||
};
|
||||
|
||||
const handleKeyDown = (e: KeyboardEvent<HTMLTextAreaElement>) => {
|
||||
if (e.key === 'Enter' && !e.shiftKey) {
|
||||
if (e.key === 'Enter' && !e.shiftKey && !e.nativeEvent.isComposing) {
|
||||
e.preventDefault();
|
||||
if (!isCreating && value.trim()) {
|
||||
handleGenerate();
|
||||
|
||||
@@ -80,7 +80,10 @@ export const createLambdaContext = async (request: NextRequest): Promise<LambdaC
|
||||
const isMockUser = process.env.ENABLE_MOCK_DEV_USER === '1';
|
||||
|
||||
if (process.env.NODE_ENV === 'development' && (isDebugApi || isMockUser)) {
|
||||
return { userId: process.env.MOCK_DEV_USER_ID };
|
||||
return {
|
||||
authorizationHeader: request.headers.get(LOBE_CHAT_AUTH_HEADER),
|
||||
userId: process.env.MOCK_DEV_USER_ID,
|
||||
};
|
||||
}
|
||||
|
||||
log('createLambdaContext called for request');
|
||||
|
||||
Reference in New Issue
Block a user