Skip to content

Commit

Permalink
removed fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
nahiyankhan committed Feb 6, 2025
1 parent 13428c7 commit 11a0cc7
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions ui/desktop/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -206,25 +206,9 @@ const createChat = async (app, query?: string, dir?: string, version?: string) =
// In production, we need to use a proper file protocol URL with correct base path
const indexPath = path.join(__dirname, `../renderer/${MAIN_WINDOW_VITE_NAME}/index.html`);
console.log('Loading production path:', indexPath);
mainWindow
.loadFile(indexPath, {
search: queryParam ? queryParam.slice(1) : undefined,
})
.catch((err) => {
console.error('Failed to load window:', err);
// Try alternative path if first attempt fails
const altPath = path.join(
app.getAppPath(),
'out',
'renderer',
MAIN_WINDOW_VITE_NAME,
'index.html'
);
console.log('Trying alternative path:', altPath);
return mainWindow.loadFile(altPath, {
search: queryParam ? queryParam.slice(1) : undefined,
});
});
mainWindow.loadFile(indexPath, {
search: queryParam ? queryParam.slice(1) : undefined,
});
}

// DevTools shortcut management
Expand Down

0 comments on commit 11a0cc7

Please sign in to comment.