Skip to content

Commit

Permalink
fix: set global variable __local_proxy in window object for app exe…
Browse files Browse the repository at this point in the history
…cution (#2256)
  • Loading branch information
lizable authored Mar 12, 2024
1 parent 193f3f8 commit 3bdc4fa
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ app.once('ready', function() {
protocol: 'file',
slashes: true
}));
mainContent.executeJavaScript(`window.__local_proxy = '${proxyUrl}'`);
mainContent.executeJavaScript(`window.__local_proxy = {}; window.__local_proxy.url = '${proxyUrl}';`);
console.log('Re-connected to proxy: ' + proxyUrl);
}
},
Expand Down
2 changes: 1 addition & 1 deletion src/components/backend-ai-app-launcher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ export default class BackendAiAppLauncher extends BackendAIPage {
param['secret_key'] = globalThis.backendaiclient._config.secretKey;
}
param['api_version'] = globalThis.backendaiclient.APIMajorVersion;
if (globalThis.isElectron && globalThis.__local_proxy.url === undefined) {
if (globalThis.isElectron && window.__local_proxy.url === undefined) {
this.indicator.end();
this.notification.text = _text('session.launcher.ProxyNotReady');
this.notification.show();
Expand Down

0 comments on commit 3bdc4fa

Please sign in to comment.