@@ -5,6 +5,7 @@ import React, {useState, useRef, useEffect, useReducer} from 'react' // eslint-d
5
5
import { FormattedMessage } from 'react-intl'
6
6
import { Tab , Tabs , TabList , TabPanel } from 'react-tabs'
7
7
import './remix-ui-tabs.css'
8
+ import { values } from 'lodash'
8
9
const _paq = ( window . _paq = window . _paq || [ ] )
9
10
10
11
/* eslint-disable-next-line */
@@ -84,8 +85,6 @@ export const TabsUI = (props: TabsUIProps) => {
84
85
}
85
86
}
86
87
87
- getAI ( ) . then ( value => setAI_switch ( value ) ) . catch ( error => console . log ( error ) )
88
-
89
88
const getFileDecorationClasses = ( tab : any ) => {
90
89
const fileDecoration = tabsState . fileDecorations . find ( ( fileDecoration : fileDecoration ) => {
91
90
if ( `${ fileDecoration . workspace . name } /${ fileDecoration . path } ` === tab . name ) return true
@@ -101,7 +100,6 @@ export const TabsUI = (props: TabsUIProps) => {
101
100
const classNameImg = 'my-1 mr-1 text-dark ' + tab . iconClass
102
101
const classNameTab = 'nav-item nav-link d-flex justify-content-center align-items-center px-2 py-1 tab' + ( index === currentIndexRef . current ? ' active' : '' )
103
102
const invert = props . themeQuality === 'dark' ? 'invert(1)' : 'invert(0)'
104
-
105
103
return (
106
104
< CustomTooltip tooltipId = "tabsActive" tooltipText = { tab . tooltip } placement = "bottom-start" >
107
105
< div
@@ -142,6 +140,7 @@ export const TabsUI = (props: TabsUIProps) => {
142
140
}
143
141
144
142
const setFileDecorations = ( fileStates : fileDecoration [ ] ) => {
143
+ getAI ( ) . then ( value => setAI_switch ( value ) ) . catch ( error => console . log ( error ) )
145
144
dispatch ( { type : 'SET_FILE_DECORATIONS' , payload : fileStates } )
146
145
}
147
146
@@ -274,7 +273,7 @@ export const TabsUI = (props: TabsUIProps) => {
274
273
data-id = "remix_ai_switch"
275
274
id = 'remix_ai_switch'
276
275
className = "btn ai-switch text-ai pl-2 pr-0 py-0 d-flex"
277
- disabled = { ! ( tabsState . currentExt === 'sol' ) }
276
+ disabled = { ! ( tabsState . currentExt === 'sol' ) }
278
277
onClick = { async ( ) => {
279
278
await props . plugin . call ( 'settings' , 'updateCopilotChoice' , ! ai_switch )
280
279
setAI_switch ( ! ai_switch )
0 commit comments