mirror of
https://github.com/QwenLM/qwen-code.git
synced 2026-05-05 07:10:55 +00:00
Ignore workspace settings for untrusted folders (#6606)
This commit is contained in:
parent
179f1414da
commit
d250293c2e
16 changed files with 386 additions and 122 deletions
24
packages/cli/src/ui/contexts/SettingsContext.ts
Normal file
24
packages/cli/src/ui/contexts/SettingsContext.ts
Normal file
|
|
@ -0,0 +1,24 @@
|
|||
/**
|
||||
* @license
|
||||
* Copyright 2025 Google LLC
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { createContext, useContext } from 'react';
|
||||
import { LoadedSettings } from '../../config/settings.js';
|
||||
|
||||
export interface SettingsContextType {
|
||||
settings: LoadedSettings;
|
||||
recomputeSettings: () => void;
|
||||
}
|
||||
|
||||
// This context is initialized in gemini.tsx with the loaded settings.
|
||||
export const SettingsContext = createContext<SettingsContextType | null>(null);
|
||||
|
||||
export function useSettings(): LoadedSettings {
|
||||
const context = useContext(SettingsContext);
|
||||
if (!context) {
|
||||
throw new Error('useSettings must be used within a SettingsProvider');
|
||||
}
|
||||
return context.settings;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue