fix extension selector syncing issues (#7133)
This commit is contained in:
@@ -437,14 +437,16 @@ const AppSidebar: React.FC<SidebarProps> = ({ currentPath }) => {
|
||||
} else {
|
||||
isCreatingSessionRef.current = true;
|
||||
try {
|
||||
await startNewSession('', setView, getInitialWorkingDir());
|
||||
await startNewSession('', setView, getInitialWorkingDir(), {
|
||||
allExtensions: configContext.extensionsList,
|
||||
});
|
||||
} finally {
|
||||
setTimeout(() => {
|
||||
isCreatingSessionRef.current = false;
|
||||
}, 1000);
|
||||
}
|
||||
}
|
||||
}, [setView, clearUnread]);
|
||||
}, [setView, clearUnread, configContext.extensionsList]);
|
||||
|
||||
useEffect(() => {
|
||||
const handleTriggerNewChat = () => {
|
||||
|
||||
@@ -34,24 +34,14 @@ export const BottomMenuExtensionSelection = ({ sessionId }: BottomMenuExtensionS
|
||||
const isHubView = !sessionId;
|
||||
|
||||
useEffect(() => {
|
||||
const handleSessionLoaded = () => {
|
||||
setTimeout(() => {
|
||||
setRefreshTrigger((prev) => prev + 1);
|
||||
}, 500);
|
||||
};
|
||||
|
||||
const handleExtensionsLoaded = () => {
|
||||
setRefreshTrigger((prev) => prev + 1);
|
||||
};
|
||||
|
||||
window.addEventListener(AppEvents.SESSION_CREATED, handleSessionLoaded);
|
||||
window.addEventListener(AppEvents.SESSION_EXTENSIONS_LOADED, handleExtensionsLoaded);
|
||||
window.addEventListener(AppEvents.MESSAGE_STREAM_FINISHED, handleSessionLoaded);
|
||||
|
||||
return () => {
|
||||
window.removeEventListener(AppEvents.SESSION_CREATED, handleSessionLoaded);
|
||||
window.removeEventListener(AppEvents.SESSION_EXTENSIONS_LOADED, handleExtensionsLoaded);
|
||||
window.removeEventListener(AppEvents.MESSAGE_STREAM_FINISHED, handleSessionLoaded);
|
||||
};
|
||||
}, []);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user