Skip to content

Commit 347f003

Browse files
committed
lint fix
1 parent 260eaef commit 347f003

4 files changed

Lines changed: 42 additions & 21 deletions

File tree

src/components/Bot.tsx

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,14 @@ import { ChevronDownIcon, CircleDotIcon, SparklesIcon, TrashIcon } from './icons
3535
import { CancelButton } from './buttons/CancelButton';
3636
import { cancelAudioRecording, startAudioRecording, stopAudioRecording } from '@/utils/audioRecording';
3737
import { LeadCaptureBubble } from '@/components/bubbles/LeadCaptureBubble';
38-
import { removeLocalStorageChatHistory, getLocalStorageChatflow, setLocalStorageChatflow, setCookie, getCookie, getRecordingExtensionForMime } from '@/utils';
38+
import {
39+
removeLocalStorageChatHistory,
40+
getLocalStorageChatflow,
41+
setLocalStorageChatflow,
42+
setCookie,
43+
getCookie,
44+
getRecordingExtensionForMime,
45+
} from '@/utils';
3946
import { FollowUpPromptBubble } from '@/components/bubbles/FollowUpPromptBubble';
4047
import { fetchEventSource, EventStreamContentType } from '@microsoft/fetch-event-source';
4148

@@ -585,7 +592,9 @@ export const Bot = (botProps: BotProps & { class?: string }) => {
585592
isProgrammaticScroll = true;
586593
if (guardTimeout) clearTimeout(guardTimeout);
587594
fn();
588-
guardTimeout = setTimeout(() => { isProgrammaticScroll = false; }, 500);
595+
guardTimeout = setTimeout(() => {
596+
isProgrammaticScroll = false;
597+
}, 500);
589598
};
590599
});
591600

@@ -655,7 +664,9 @@ export const Bot = (botProps: BotProps & { class?: string }) => {
655664
audioRef.currentTime = 0;
656665
}
657666
audioRef = new Audio(audioSrc);
658-
audioRef.play().catch(() => { /* ignore autoplay errors */ });
667+
audioRef.play().catch(() => {
668+
/* ignore autoplay errors */
669+
});
659670
}
660671
};
661672

@@ -1001,7 +1012,6 @@ export const Bot = (botProps: BotProps & { class?: string }) => {
10011012
}
10021013
};
10031014

1004-
10051015
const handleFileUploads = async (uploads: IUploads) => {
10061016
if (!uploadedFiles().length) return uploads;
10071017

@@ -1583,7 +1593,7 @@ export const Bot = (botProps: BotProps & { class?: string }) => {
15831593
} else {
15841594
mimeType = blob.type.substring(0, pos);
15851595
}
1586-
const ext = getRecordingExtensionForMime(mimeType)
1596+
const ext = getRecordingExtensionForMime(mimeType);
15871597
// read blob and add to previews
15881598
const reader = new FileReader();
15891599
reader.readAsDataURL(blob);
Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,16 @@
11
import { JSX } from 'solid-js/jsx-runtime';
22

33
export const ChevronDownIcon = (props: JSX.SvgSVGAttributes<SVGSVGElement>) => (
4-
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.5" stroke-linecap="round" stroke-linejoin="round" {...props}>
4+
<svg
5+
xmlns="http://www.w3.org/2000/svg"
6+
viewBox="0 0 24 24"
7+
fill="none"
8+
stroke="currentColor"
9+
stroke-width="2.5"
10+
stroke-linecap="round"
11+
stroke-linejoin="round"
12+
{...props}
13+
>
514
<path d="M6 9l6 6 6-6" />
615
</svg>
716
);

src/components/inputs/textInput/components/TextInput.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,9 @@ export const TextInput = (props: TextInputProps) => {
7575
}
7676
props.onSubmit(props.inputValue);
7777
if (props.sendMessageSound && audioRef) {
78-
audioRef.play().catch(() => { /* ignore autoplay errors */ });
78+
audioRef.play().catch(() => {
79+
/* ignore autoplay errors */
80+
});
7981
}
8082
}
8183
};

src/utils/index.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -155,19 +155,19 @@ export const getCookie = (cname: string): string => {
155155

156156
export const getRecordingExtensionForMime = (mime: string) => {
157157
const mimeToExt: Record<string, string> = {
158-
'audio/webm': 'webm',
159-
'audio/mp4': 'm4a',
160-
'audio/x-m4a': 'm4a',
161-
'audio/ogg': 'ogg',
162-
'audio/oga': 'ogg',
163-
'audio/wav': 'wav',
164-
'audio/wave': 'wav',
165-
'audio/x-wav': 'wav'
166-
}
167-
const extension = mimeToExt[mime]
158+
'audio/webm': 'webm',
159+
'audio/mp4': 'm4a',
160+
'audio/x-m4a': 'm4a',
161+
'audio/ogg': 'ogg',
162+
'audio/oga': 'ogg',
163+
'audio/wav': 'wav',
164+
'audio/wave': 'wav',
165+
'audio/x-wav': 'wav',
166+
};
167+
const extension = mimeToExt[mime];
168168
if (extension) {
169-
return extension
169+
return extension;
170170
}
171-
console.warn(`Unsupported audio MIME type: ${mime}. Defaulting to 'webm'.`)
172-
return 'webm'
173-
}
171+
console.warn(`Unsupported audio MIME type: ${mime}. Defaulting to 'webm'.`);
172+
return 'webm';
173+
};

0 commit comments

Comments
 (0)