From 3fa617f0d20ec7a14d6a869c6a5fe24754ad879b Mon Sep 17 00:00:00 2001 From: Zef Hemel Date: Wed, 25 Jan 2023 11:48:35 +0100 Subject: [PATCH] Only show recent documents menu on Mac --- desktop/src/menu.ts | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/desktop/src/menu.ts b/desktop/src/menu.ts index e9cac02..872b764 100644 --- a/desktop/src/menu.ts +++ b/desktop/src/menu.ts @@ -1,6 +1,7 @@ import { app, Menu, MenuItemConstructorOptions, shell } from "electron"; import { findInstanceByUrl, newWindow, openFolderPicker } from "./instance"; import { newWindowState } from "./store"; +import os from "node:os"; const template: MenuItemConstructorOptions[] = [ { @@ -25,14 +26,16 @@ const template: MenuItemConstructorOptions[] = [ openFolderPicker(); }, }, - { - role: "recentDocuments", - submenu: [ - { - role: "clearRecentDocuments", - }, - ], - }, + os.platform() === "darwin" + ? { + role: "recentDocuments", + submenu: [ + { + role: "clearRecentDocuments", + }, + ], + } + : undefined, { type: "separator" }, { label: "Quit",