removed electron
This commit is contained in:
@ -1,8 +1,8 @@
|
||||
/**
|
||||
* tauri-bridge.ts
|
||||
*
|
||||
* Polyfills window.electronAPI with Tauri equivalents so all existing
|
||||
* call-sites in App.tsx, hooks, and stores continue to work unchanged.
|
||||
* Exposes window.desktopAPI using Tauri equivalents so UI code can stay
|
||||
* desktop-runtime agnostic.
|
||||
*
|
||||
* Imported once at the top of main.tsx.
|
||||
*/
|
||||
@ -25,7 +25,10 @@ const EXPORT_FILTERS = [
|
||||
{ name: 'Project Files', extensions: ['aive'] },
|
||||
];
|
||||
|
||||
window.electronAPI = {
|
||||
const BACKEND_PORT = import.meta.env.VITE_BACKEND_PORT || '8000';
|
||||
const BACKEND_URL = `http://127.0.0.1:${BACKEND_PORT}`;
|
||||
|
||||
window.desktopAPI = {
|
||||
openFile: async (_options?: Record<string, unknown>): Promise<string | null> => {
|
||||
const result = await open({
|
||||
multiple: false,
|
||||
@ -53,8 +56,8 @@ window.electronAPI = {
|
||||
},
|
||||
|
||||
getBackendUrl: (): Promise<string> => {
|
||||
// Backend URL is fixed; avoid invoke() which triggers ipc:// CSP errors on Linux/WebKit2GTK
|
||||
return Promise.resolve('http://127.0.0.1:8000');
|
||||
// Use env-driven backend URL and avoid invoke() to bypass ipc:// noise on Linux/WebKit2GTK.
|
||||
return Promise.resolve(BACKEND_URL);
|
||||
},
|
||||
|
||||
encryptString: (data: string): Promise<string> => {
|
||||
|
||||
Reference in New Issue
Block a user