@@ -23,6 +23,7 @@ export default function Topic({ styleName, disabled }) {
2323 useDisclosure ( false ) ;
2424 const [ loading , setLoading ] = useState ( false ) ;
2525 const [ topicList , setTopicList ] = useState < any > ( [ ] ) ;
26+ const isVscode = process . env . platform === "vscode" ;
2627
2728 useEffect ( ( ) => {
2829 messageUtil . registerHandler ( "listTopics" , ( { list } : { list : any } ) => {
@@ -46,14 +47,17 @@ export default function Topic({ styleName, disabled }) {
4647
4748 const showTopic = ( root_prompt : any ) => {
4849 closeDrawer ( ) ;
49- // messageUtil.sendMessage({
50- // command: "getTopicDetail",
51- // topicHash: root_prompt.hash,
52- // });
53- messageUtil . sendMessage ( {
54- command : "historyMessages" ,
55- topicId : root_prompt . hash ,
56- } ) ;
50+ if ( isVscode ) {
51+ messageUtil . sendMessage ( {
52+ command : "historyMessages" ,
53+ topicId : root_prompt . hash ,
54+ } ) ;
55+ } else {
56+ messageUtil . sendMessage ( {
57+ command : "getTopicDetail" ,
58+ topicHash : root_prompt . hash ,
59+ } ) ;
60+ }
5761 } ;
5862
5963 const refreshTopicList = ( ) => {
0 commit comments