mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-17 09:30:58 -07:00
Refactor IdeContextStore (#8278)
This commit is contained in:
committed by
GitHub
parent
538e6cd19a
commit
d892cde0b0
@@ -5,7 +5,7 @@
|
||||
*/
|
||||
|
||||
import { useCallback, useEffect, useState, useSyncExternalStore } from 'react';
|
||||
import { IdeClient, ideContext } from '@google/gemini-cli-core';
|
||||
import { IdeClient, ideContextStore } from '@google/gemini-cli-core';
|
||||
|
||||
/**
|
||||
* This hook listens for trust status updates from the IDE companion extension.
|
||||
@@ -26,8 +26,7 @@ export function useIdeTrustListener() {
|
||||
};
|
||||
}, []);
|
||||
|
||||
const getSnapshot = () =>
|
||||
ideContext.getIdeContext()?.workspaceState?.isTrusted;
|
||||
const getSnapshot = () => ideContextStore.get()?.workspaceState?.isTrusted;
|
||||
|
||||
const isIdeTrusted = useSyncExternalStore(subscribe, getSnapshot);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user