Import ContextMenuItem from contracts in desktop app
Remove the duplicate DesktopContextMenuItem interface and use the shared ContextMenuItem type from @t3tools/contracts instead. Co-Authored-By: Claude Opus 4.6 <[email protected]>
This commit is contained in:
1 parent
c530e5d50f
commit
9e2e73c070
1 file changed
+2
-7
@@ -8,6 +8,7 @@ import path from "node:path";
|
||||
import { app, BrowserWindow, dialog, ipcMain, Menu, nativeImage, protocol, shell } from "electron";
|
||||
import type { MenuItemConstructorOptions } from "electron";
|
||||
|
||||
import type { ContextMenuItem } from "@t3tools/contracts";
|
||||
import { showDesktopConfirmDialog } from "./confirmDialog";
|
||||
import { fixPath } from "./fixPath";
|
||||
|
||||
@@ -36,12 +37,6 @@ let restartTimer: ReturnType<typeof setTimeout> | null = null;
|
||||
let isQuitting = false;
|
||||
let desktopProtocolRegistered = false;
|
||||
|
||||
interface DesktopContextMenuItem {
|
||||
id: string;
|
||||
label: string;
|
||||
destructive?: boolean;
|
||||
}
|
||||
|
||||
let destructiveMenuIconCache: Electron.NativeImage | null | undefined;
|
||||
|
||||
function getDestructiveMenuIcon(): Electron.NativeImage | undefined {
|
||||
@@ -439,7 +434,7 @@ function registerIpcHandlers(): void {
|
||||
CONTEXT_MENU_CHANNEL,
|
||||
async (
|
||||
_event,
|
||||
items: DesktopContextMenuItem[],
|
||||
items: ContextMenuItem[],
|
||||
position?: { x: number; y: number },
|
||||
) => {
|
||||
const normalizedItems = items
|
||||
|
||||
Reference in new issue
Block a user