chenbhao commited on
Commit
5663b68
·
1 Parent(s): 46c0fae

fix: just friend desktop no browser

Browse files
Files changed (1) hide show
  1. src/server/index.ts +1 -9
src/server/index.ts CHANGED
@@ -19,7 +19,6 @@ import { handleFriendApi, setFriendServerInfo } from './api/friend.js'
19
  import { handleFriendStaticRequest } from './staticFriend.js'
20
  import { getPrefs } from '../friend/prefs.js'
21
  import { launchTauri, stopTauri } from '../friend/tauri-launcher.js'
22
- import { openBrowser } from '../utils/browser.js'
23
  import { fileURLToPath } from 'node:url'
24
  import path from 'node:path'
25
  import { OPENAI_CODEX_REDIRECT_PATH } from '../services/openaiAuth/client.js'
@@ -432,22 +431,15 @@ export function startServer(port = PORT, host = HOST) {
432
  // Register Friend server info so the chat service can construct SDK URLs
433
  setFriendServerInfo(host, port)
434
 
435
- // ── Friend: launch Tauri desktop window or browser fallback when enabled ──
436
  if (getPrefs().enabled) {
437
  const friendUrl = `http://${localConnectHost}:${port}/friend/`
438
  console.log(`[Friend] VRM frontend available at ${friendUrl}`)
439
 
440
- // Try launching Tauri desktop window first
441
- const _srcDir = path.dirname(fileURLToPath(import.meta.url))
442
- const friendFrontendDir = path.resolve(_srcDir, '..', '..', 'src', 'components', 'friend', 'frontend')
443
  launchTauri({
444
  info: (msg: string) => console.log(`[Friend] ${msg}`),
445
  warn: (msg: string) => console.warn(`[Friend] ${msg}`),
446
  })
447
-
448
- // Fallback: open browser for the static frontend
449
- // If Tauri launches successfully, this is redundant but harmless
450
- openBrowser(friendUrl).catch(() => {})
451
  }
452
 
453
  return server
 
19
  import { handleFriendStaticRequest } from './staticFriend.js'
20
  import { getPrefs } from '../friend/prefs.js'
21
  import { launchTauri, stopTauri } from '../friend/tauri-launcher.js'
 
22
  import { fileURLToPath } from 'node:url'
23
  import path from 'node:path'
24
  import { OPENAI_CODEX_REDIRECT_PATH } from '../services/openaiAuth/client.js'
 
431
  // Register Friend server info so the chat service can construct SDK URLs
432
  setFriendServerInfo(host, port)
433
 
434
+ // ── Friend: launch Tauri desktop window when enabled ──
435
  if (getPrefs().enabled) {
436
  const friendUrl = `http://${localConnectHost}:${port}/friend/`
437
  console.log(`[Friend] VRM frontend available at ${friendUrl}`)
438
 
 
 
 
439
  launchTauri({
440
  info: (msg: string) => console.log(`[Friend] ${msg}`),
441
  warn: (msg: string) => console.warn(`[Friend] ${msg}`),
442
  })
 
 
 
 
443
  }
444
 
445
  return server