Skip to content

Commit fcd7824

Browse files
STetsingci-bot
authored andcommitted
rm global function
1 parent e015c26 commit fcd7824

File tree

3 files changed

+4
-13
lines changed

3 files changed

+4
-13
lines changed

.gitignore

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,8 @@ apps/remixdesktop/log_input_signals_new.txt
7979
logs
8080
apps/remix-ide-e2e/src/extensions/chrome/metamask
8181
apps/remix-ide-e2e/tmp/
82-
apps/remix-ide-e2e/tmp/
8382

8483
# IDE - Cursor
85-
<<<<<<< HEAD
86-
.cursor/
87-
=======
8884
.cursor/
8985
PR_MESSAGE.md
90-
>>>>>>> master
86+
apps/remix-ide-e2e/tmp/

apps/remix-ide/src/app/plugins/remixAIPlugin.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,7 @@ export class RemixAIPlugin extends Plugin {
6464

6565
onActivation(): void {
6666
// Expose Ollama reset function globally for settings integration
67-
if (typeof window !== 'undefined') {
68-
(window as any).resetOllamaHostOnSettingsChange = resetOllamaHostOnSettingsChange;
69-
}
67+
resetOllamaHostOnSettingsChange();
7068

7169
if (this.isOnDesktop) {
7270
this.useRemoteInferencer = true

libs/remix-ui/settings/src/lib/settingsReducer.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { Registry } from '@remix-project/remix-lib'
22
import { SettingsActions, SettingsState } from '../types'
3-
3+
import { resetOllamaHostOnSettingsChange } from '@remix/remix-ai-core';
44
const config = Registry.getInstance().get('config').api
55
const settingsConfig = Registry.getInstance().get('settingsConfig').api
66
const defaultTheme = config.get('settings/theme') ? settingsConfig.themes.find((theme) => theme.name.toLowerCase() === config.get('settings/theme').toLowerCase()) : settingsConfig.themes[0]
@@ -225,10 +225,7 @@ export const settingReducer = (state: SettingsState, action: SettingsActions): S
225225
// Reset Ollama host cache when endpoint is changed
226226
if (action.payload.name === 'ollama-endpoint') {
227227
try {
228-
// Check if the resetOllamaHostOnSettingsChange function is available globally
229-
if (typeof window !== 'undefined' && (window as any).resetOllamaHostOnSettingsChange) {
230-
(window as any).resetOllamaHostOnSettingsChange();
231-
}
228+
resetOllamaHostOnSettingsChange();
232229
} catch (error) {
233230
// Ignore errors - Ollama functionality is optional
234231
}

0 commit comments

Comments
 (0)