summaryrefslogtreecommitdiff
path: root/packages/cli/src/ui/hooks/useThemeCommand.ts
diff options
context:
space:
mode:
authorshrutip90 <[email protected]>2025-08-19 21:20:41 -0700
committerGitHub <[email protected]>2025-08-20 04:20:41 +0000
commitd250293c2e0a4a50f5ef6b4b6cd3257730338d13 (patch)
treeda91b3cc7af02e40bc80df6857a2b2abcc12d4e3 /packages/cli/src/ui/hooks/useThemeCommand.ts
parent179f1414daf9058a05d38a170c0d36ca9f2b8547 (diff)
Ignore workspace settings for untrusted folders (#6606)
Diffstat (limited to 'packages/cli/src/ui/hooks/useThemeCommand.ts')
-rw-r--r--packages/cli/src/ui/hooks/useThemeCommand.ts10
1 files changed, 6 insertions, 4 deletions
diff --git a/packages/cli/src/ui/hooks/useThemeCommand.ts b/packages/cli/src/ui/hooks/useThemeCommand.ts
index cf881f53..06d1c5b1 100644
--- a/packages/cli/src/ui/hooks/useThemeCommand.ts
+++ b/packages/cli/src/ui/hooks/useThemeCommand.ts
@@ -4,10 +4,11 @@
* SPDX-License-Identifier: Apache-2.0
*/
-import { useState, useCallback, useEffect } from 'react';
+import { useState, useCallback, useEffect, useContext } from 'react';
import { themeManager } from '../themes/theme-manager.js';
-import { LoadedSettings, SettingScope } from '../../config/settings.js'; // Import LoadedSettings, AppSettings, MergedSetting
-import { type HistoryItem, MessageType } from '../types.js';
+import { HistoryItem, MessageType } from '../types.js';
+import { SettingScope } from '../../config/settings.js';
+import { SettingsContext } from '../contexts/SettingsContext.js';
import process from 'node:process';
interface UseThemeCommandReturn {
@@ -21,11 +22,12 @@ interface UseThemeCommandReturn {
}
export const useThemeCommand = (
- loadedSettings: LoadedSettings,
setThemeError: (error: string | null) => void,
addItem: (item: Omit<HistoryItem, 'id'>, timestamp: number) => void,
): UseThemeCommandReturn => {
const [isThemeDialogOpen, setIsThemeDialogOpen] = useState(false);
+ const settingsContext = useContext(SettingsContext);
+ const loadedSettings = settingsContext!.settings;
// Check for invalid theme configuration on startup
useEffect(() => {