mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-25 00:36:31 +02:00
feat: implement quick assist mode detection in AssistantActionBar
- Added state management for quick assist mode using the Electron API. - Introduced a useEffect hook to asynchronously check and set the quick assist mode based on the API response, enhancing the component's interactivity.
This commit is contained in:
parent
518cacf56e
commit
80f775581b
1 changed files with 7 additions and 1 deletions
|
|
@ -465,8 +465,14 @@ const AssistantActionBar: FC = () => {
|
|||
const isLast = useAuiState((s) => s.message.isLast);
|
||||
const aui = useAui();
|
||||
const api = useElectronAPI();
|
||||
const [isQuickAssist, setIsQuickAssist] = useState(false);
|
||||
|
||||
const isQuickAssist = !!api?.replaceText && !!api?.getQuickAskMode;
|
||||
useEffect(() => {
|
||||
if (!api?.getQuickAskMode) return;
|
||||
api.getQuickAskMode().then((mode) => {
|
||||
if (mode) setIsQuickAssist(true);
|
||||
});
|
||||
}, [api]);
|
||||
|
||||
return (
|
||||
<ActionBarPrimitive.Root
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue