fix: improve startup readiness performance
This commit is contained in:
@@ -114,8 +114,8 @@ const MiniChatBootstrap: React.FC<{ config: MiniChatConfig }> = ({ config }) =>
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!isConnected) return;
|
||||
if (providersCount === 0) void loadProviders();
|
||||
if (agentsCount === 0) void loadAgents();
|
||||
if (providersCount === 0) void loadProviders({ source: 'electronMiniChat:recovery' });
|
||||
if (agentsCount === 0) void loadAgents({ source: 'electronMiniChat:recovery' });
|
||||
}, [agentsCount, isConnected, loadAgents, loadProviders, providersCount]);
|
||||
|
||||
const sessionBootstrappedRef = React.useRef(false);
|
||||
|
||||
@@ -373,8 +373,8 @@ export function MobileApp({ apis }: MobileAppProps) {
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!isConnected) return;
|
||||
if (providersCount === 0) void loadProviders();
|
||||
if (agentsCount === 0) void loadAgents();
|
||||
if (providersCount === 0) void loadProviders({ source: 'mobileApp:recovery' });
|
||||
if (agentsCount === 0) void loadAgents({ source: 'mobileApp:recovery' });
|
||||
}, [agentsCount, isConnected, loadAgents, loadProviders, providersCount]);
|
||||
|
||||
React.useEffect(() => {
|
||||
|
||||
Reference in New Issue
Block a user