Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions ui/desktop/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ export default function App() {
if (provider && model) {
setView('chat');
try {
await initializeSystem(provider, model, {
await initializeSystem(provider as string, model as string, {
getExtensions,
addExtension,
});
Expand Down Expand Up @@ -231,9 +231,9 @@ export default function App() {
setIsLoadingSharedSession(false);
}
};
window.electron.on('open-shared-session', handleOpenSharedSession);
window.electron.on('open-shared-session', handleOpenSharedSession as any);
return () => {
window.electron.off('open-shared-session', handleOpenSharedSession);
window.electron.off('open-shared-session', handleOpenSharedSession as any);
};
}, []);

Expand Down Expand Up @@ -266,9 +266,9 @@ export default function App() {
console.error('Is loading session:', isLoadingSession);
setFatalError(errorMessage);
};
window.electron.on('fatal-error', handleFatalError);
window.electron.on('fatal-error', handleFatalError as any);
return () => {
window.electron.off('fatal-error', handleFatalError);
window.electron.off('fatal-error', handleFatalError as any);
};
}, [view, isLoadingSession]);

Expand All @@ -289,11 +289,11 @@ export default function App() {
};
setView(viewFromUrl, initialViewOptions);
} else {
setView(viewFromUrl);
setView(viewFromUrl as View);
}
}
window.electron.on('set-view', handleSetView);
return () => window.electron.off('set-view', handleSetView);
window.electron.on('set-view', handleSetView as any);
return () => window.electron.off('set-view', handleSetView as any);
}, []);

useEffect(() => {
Expand Down Expand Up @@ -375,9 +375,9 @@ export default function App() {
console.error('Error handling add-extension event:', error);
}
};
window.electron.on('add-extension', handleAddExtension);
window.electron.on('add-extension', handleAddExtension as any);
return () => {
window.electron.off('add-extension', handleAddExtension);
window.electron.off('add-extension', handleAddExtension as any);
};
}, [STRICT_ALLOWLIST]);

Expand All @@ -388,9 +388,9 @@ export default function App() {
inputField.focus();
}
};
window.electron.on('focus-input', handleFocusInput);
window.electron.on('focus-input', handleFocusInput as any);
return () => {
window.electron.off('focus-input', handleFocusInput);
window.electron.off('focus-input', handleFocusInput as any);
};
}, []);

Expand Down
2 changes: 1 addition & 1 deletion ui/desktop/src/components/ChatView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ function ChatContent({

// Update chat messages when they change and save to sessionStorage
useEffect(() => {
setChat((prevChat) => {
setChat((prevChat: ChatType) => {
const updatedChat = { ...prevChat, messages };
return updatedChat;
});
Expand Down
10 changes: 5 additions & 5 deletions ui/desktop/src/components/GoosehintsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Card } from './ui/card';
import { Button } from './ui/button';
import { Check } from './icons';

const Modal = ({ children }) => (
const Modal = ({ children }: { children: React.ReactNode }) => (
<div className="fixed inset-0 bg-black/20 dark:bg-white/20 backdrop-blur-sm transition-colors animate-[fadein_200ms_ease-in_forwards] z-[1000]">
<Card className="fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 flex flex-col min-w-[80%] min-h-[80%] bg-bgApp rounded-xl overflow-hidden shadow-none px-8 pt-[24px] pb-0">
<div className="flex flex-col flex-1 space-y-8 text-base text-textStandard h-full">
Expand Down Expand Up @@ -48,13 +48,13 @@ const ModalHelpText = () => (
</div>
);

const ModalError = ({ error }) => (
const ModalError = ({ error }: { error: any }) => (
<div className="text-sm text-textSubtle">
<div className="text-red-600">Error reading .goosehints file: {JSON.stringify(error)}</div>
</div>
);

const ModalFileInfo = ({ filePath, found }) => (
const ModalFileInfo = ({ filePath, found }: { filePath: string; found: boolean }) => (
<div className="text-sm font-medium">
{found ? (
<div className="text-green-600">
Expand All @@ -66,7 +66,7 @@ const ModalFileInfo = ({ filePath, found }) => (
</div>
);

const ModalButtons = ({ onSubmit, onCancel }) => (
const ModalButtons = ({ onSubmit, onCancel }: { onSubmit: () => void; onCancel: () => void }) => (
<div className="-ml-8 -mr-8">
<Button
type="submit"
Expand All @@ -87,7 +87,7 @@ const ModalButtons = ({ onSubmit, onCancel }) => (
</div>
);

const getGoosehintsFile = async (filePath) => await window.electron.readFile(filePath);
const getGoosehintsFile = async (filePath: string) => await window.electron.readFile(filePath);

type GoosehintsModalProps = {
directory: string;
Expand Down