mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-22 11:04:42 -07:00
fix: add privacy settings hook and tests (#6360)
This commit is contained in:
@@ -5,7 +5,12 @@
|
||||
*/
|
||||
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import { Config, CodeAssistServer, UserTierId } from '@google/gemini-cli-core';
|
||||
import {
|
||||
Config,
|
||||
CodeAssistServer,
|
||||
UserTierId,
|
||||
LoggingContentGenerator,
|
||||
} from '@google/gemini-cli-core';
|
||||
|
||||
export interface PrivacyState {
|
||||
isLoading: boolean;
|
||||
@@ -80,7 +85,13 @@ export const usePrivacySettings = (config: Config) => {
|
||||
};
|
||||
|
||||
function getCodeAssistServer(config: Config): CodeAssistServer {
|
||||
const server = config.getGeminiClient().getContentGenerator();
|
||||
let server = config.getGeminiClient().getContentGenerator();
|
||||
|
||||
// Unwrap LoggingContentGenerator if present
|
||||
if (server instanceof LoggingContentGenerator) {
|
||||
server = server.getWrapped();
|
||||
}
|
||||
|
||||
// Neither of these cases should ever happen.
|
||||
if (!(server instanceof CodeAssistServer)) {
|
||||
throw new Error('Oauth not being used');
|
||||
|
||||
Reference in New Issue
Block a user