mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-08-09 00:16:57 -07:00
fix(patch): cherry-pick 81ccd80 to release/v0.28.0-preview.5-pr-18406 to patch version v0.28.0-preview.5 and create version 0.28.0-preview.6 (#18651)
Co-authored-by: Gal Zahavi <38544478+galz10@users.noreply.github.com> Co-authored-by: galz10 <galzahavi@google.com>
This commit is contained in:
@@ -92,12 +92,12 @@ export const usePermissionsModifyTrust = (
|
||||
settings.merged.security.folderTrust.enabled ?? true;
|
||||
|
||||
const updateTrustLevel = useCallback(
|
||||
(trustLevel: TrustLevel) => {
|
||||
async (trustLevel: TrustLevel) => {
|
||||
// If we are not editing the current workspace, the logic is simple:
|
||||
// just save the setting and exit. No restart or warnings are needed.
|
||||
if (!isCurrentWorkspace) {
|
||||
const folders = loadTrustedFolders();
|
||||
folders.setValue(cwd, trustLevel);
|
||||
await folders.setValue(cwd, trustLevel);
|
||||
onExit();
|
||||
return;
|
||||
}
|
||||
@@ -140,7 +140,7 @@ export const usePermissionsModifyTrust = (
|
||||
} else {
|
||||
const folders = loadTrustedFolders();
|
||||
try {
|
||||
folders.setValue(cwd, trustLevel);
|
||||
await folders.setValue(cwd, trustLevel);
|
||||
} catch (_e) {
|
||||
coreEvents.emitFeedback(
|
||||
'error',
|
||||
@@ -153,11 +153,11 @@ export const usePermissionsModifyTrust = (
|
||||
[cwd, settings.merged, onExit, addItem, isCurrentWorkspace],
|
||||
);
|
||||
|
||||
const commitTrustLevelChange = useCallback(() => {
|
||||
const commitTrustLevelChange = useCallback(async () => {
|
||||
if (pendingTrustLevel) {
|
||||
const folders = loadTrustedFolders();
|
||||
try {
|
||||
folders.setValue(cwd, pendingTrustLevel);
|
||||
await folders.setValue(cwd, pendingTrustLevel);
|
||||
return true;
|
||||
} catch (_e) {
|
||||
coreEvents.emitFeedback(
|
||||
|
||||
Reference in New Issue
Block a user