| ... | @@ -5,20 +5,11 @@ import net from "node:net"; | ... | @@ -5,20 +5,11 @@ import net from "node:net"; |
| 5 | import os from "node:os"; | 5 | import os from "node:os"; |
| 6 | import path from "node:path"; | 6 | import path from "node:path"; |
| 7 | | 7 | |
| 8 | import { | 8 | import { app, BrowserWindow, dialog, ipcMain, Menu, protocol, shell } from "electron"; |
| 9 | app, | 9 | import type { MenuItemConstructorOptions } from "electron"; |
| 10 | BrowserWindow, | | |
| 11 | dialog, | | |
| 12 | ipcMain, | | |
| 13 | Menu, | | |
| 14 | type MenuItemConstructorOptions, | | |
| 15 | protocol, | | |
| 16 | shell, | | |
| 17 | } from "electron"; | | |
| 18 | | 10 | |
| 19 | import { showDesktopConfirmDialog } from "./confirmDialog"; | 11 | import { showDesktopConfirmDialog } from "./confirmDialog"; |
| 20 | import { fixPath } from "./fixPath"; | 12 | import { fixPath } from "./fixPath"; |
| 21 | import { resolveDesktopStateDir } from "./stateDir"; | | |
| 22 | | 13 | |
| 23 | fixPath(); | 14 | fixPath(); |
| 24 | | 15 | |
| ... | @@ -27,7 +18,8 @@ const CONFIRM_CHANNEL = "desktop:confirm"; | ... | @@ -27,7 +18,8 @@ const CONFIRM_CHANNEL = "desktop:confirm"; |
| 27 | const CONTEXT_MENU_CHANNEL = "desktop:context-menu"; | 18 | const CONTEXT_MENU_CHANNEL = "desktop:context-menu"; |
| 28 | const OPEN_EXTERNAL_CHANNEL = "desktop:open-external"; | 19 | const OPEN_EXTERNAL_CHANNEL = "desktop:open-external"; |
| 29 | const MENU_ACTION_CHANNEL = "desktop:menu-action"; | 20 | const MENU_ACTION_CHANNEL = "desktop:menu-action"; |
| 30 | const STATE_DIR = resolveDesktopStateDir(); | 21 | const STATE_DIR = |
| | 22 | process.env.T3CODE_STATE_DIR?.trim() ?? path.join(os.homedir(), ".t3", "userdata"); |
| 31 | const DESKTOP_SCHEME = "t3"; | 23 | const DESKTOP_SCHEME = "t3"; |
| 32 | const ROOT_DIR = path.resolve(__dirname, "../../.."); | 24 | const ROOT_DIR = path.resolve(__dirname, "../../.."); |
| 33 | const isDevelopment = Boolean(process.env.VITE_DEV_SERVER_URL); | 25 | const isDevelopment = Boolean(process.env.VITE_DEV_SERVER_URL); |