File tree Expand file tree Collapse file tree 2 files changed +10
-16
lines changed
app/[locale]/[workspaceid] Expand file tree Collapse file tree 2 files changed +10
-16
lines changed Original file line number Diff line number Diff line change @@ -71,13 +71,6 @@ export default function WorkspaceLayout({ children }: WorkspaceLayoutProps) {
71
71
} , [ ] )
72
72
73
73
useEffect ( ( ) => {
74
- const isInChat = window ?. location ?. pathname === "/chat"
75
-
76
- if ( ! selectedWorkspace && ! isInChat ) {
77
- setLoading ( false )
78
- return
79
- }
80
-
81
74
; ( async ( ) => await fetchWorkspaceData ( workspaceId ) ) ( )
82
75
83
76
setUserInput ( "" )
Original file line number Diff line number Diff line change @@ -121,17 +121,20 @@ export const GlobalState: FC<GlobalStateProps> = ({ children }) => {
121
121
const [ toolInUse , setToolInUse ] = useState < string > ( "none" )
122
122
123
123
useEffect ( ( ) => {
124
- const fetchData = async ( ) => {
124
+ ; ( async ( ) => {
125
125
const profile = await fetchStartingData ( )
126
126
127
127
if ( profile ) {
128
- const data = await fetchHostedModels ( profile )
129
- if ( ! data ) return
128
+ const hostedModelRes = await fetchHostedModels ( profile )
129
+ if ( ! hostedModelRes ) return
130
130
131
- setEnvKeyMap ( data . envKeyMap )
132
- setAvailableHostedModels ( data . hostedModels )
131
+ setEnvKeyMap ( hostedModelRes . envKeyMap )
132
+ setAvailableHostedModels ( hostedModelRes . hostedModels )
133
133
134
- if ( profile [ "openrouter_api_key" ] || data . envKeyMap [ "openrouter" ] ) {
134
+ if (
135
+ profile [ "openrouter_api_key" ] ||
136
+ hostedModelRes . envKeyMap [ "openrouter" ]
137
+ ) {
135
138
const openRouterModels = await fetchOpenRouterModels ( )
136
139
if ( ! openRouterModels ) return
137
140
setAvailableOpenRouterModels ( openRouterModels )
@@ -143,9 +146,7 @@ export const GlobalState: FC<GlobalStateProps> = ({ children }) => {
143
146
if ( ! localModels ) return
144
147
setAvailableLocalModels ( localModels )
145
148
}
146
- }
147
-
148
- fetchData ( )
149
+ } ) ( )
149
150
} , [ ] )
150
151
151
152
const fetchStartingData = async ( ) => {
You can’t perform that action at this time.
0 commit comments