diff --git a/libs/remix-ui/statusbar/src/lib/components/aiStatus.tsx b/libs/remix-ui/statusbar/src/lib/components/aiStatus.tsx index 255602004f..46ad4ba524 100644 --- a/libs/remix-ui/statusbar/src/lib/components/aiStatus.tsx +++ b/libs/remix-ui/statusbar/src/lib/components/aiStatus.tsx @@ -14,13 +14,11 @@ export default function AIStatus(props: AIStatusProps) { const [copilotActive, setCopilotActive] = useState(false) useEffect(() => { const run = async () => { - props.plugin.on('fileManager', 'currentFileChanged', async (isAiActive) => { - const aiActivate = await props.plugin.call('settings', 'get', 'settings/copilot/suggest/activate') - setCopilotActive(aiActivate) - }) + const aiActivate = await props.plugin.call('settings', 'get', 'settings/copilot/suggest/activate') + setCopilotActive(aiActivate) } run() - }, [props.plugin.isAiActive, props.isAiActive]) + }, []) useEffect(() => { const run = async () => { @@ -30,7 +28,7 @@ export default function AIStatus(props: AIStatusProps) { }) } run() - }, [props.plugin.isAiActive]) + }, [props.plugin.isAiActive, props.plugin.isAiActive]) return (