mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2024-11-28 00:16:55 +00:00
take out toggle button when closing tab
This commit is contained in:
parent
0566f19e87
commit
44667beba9
@ -66,6 +66,15 @@ export const QueryCopilotTab: React.FC<QueryCopilotProps> = ({ explorer }: Query
|
||||
useCommandBar.getState().setContextButtons(getCommandbarButtons());
|
||||
}, [query, selectedQuery, copilotActive]);
|
||||
|
||||
React.useEffect(() => {
|
||||
return () => {
|
||||
const commandbarButtons = getCommandbarButtons();
|
||||
commandbarButtons.pop();
|
||||
commandbarButtons.map((props: CommandButtonComponentProps) => (props.disabled = true));
|
||||
useCommandBar.getState().setContextButtons(commandbarButtons);
|
||||
};
|
||||
}, []);
|
||||
|
||||
const toggleCopilot = (toggle: boolean) => {
|
||||
setCopilotActive(toggle);
|
||||
localStorage.setItem(`${userContext.databaseAccount?.id}-queryCopilotToggleStatus`, toggle.toString());
|
||||
|
Loading…
Reference in New Issue
Block a user