tray menu ordering

Signed-off-by: FTCHD <144691102+FTCHD@users.noreply.github.com>
This commit is contained in:
FTCHD
2025-11-01 20:37:43 +01:00
parent 746aaacea4
commit e3990ba6ce
+16 -16
View File
@@ -501,22 +501,7 @@ export async function buildMenu() {
menuItems.push(copyMenuItem)
}
if (!persistedStoreState.disabledActions?.includes('tray-sync')) {
const syncMenuItem = await MenuItem.new({
id: 'sync',
text: 'Sync',
action: async () => {
await openWindow({
name: 'Sync',
url: '/sync',
})
},
})
menuItems.push(syncMenuItem)
}
if (!persistedStoreState.disabledActions?.includes('tray-download')) {
// @ts-ignore added elsewhere
const downloadMenuItem = await MenuItem.new({
id: 'download',
text: 'Download',
@@ -527,10 +512,11 @@ export async function buildMenu() {
})
},
})
// menuItems.push(downloadMenuItem)
menuItems.push(downloadMenuItem)
}
const allowsAdditional =
!persistedStoreState.disabledActions?.includes('tray-sync') ||
!persistedStoreState.disabledActions?.includes('tray-move') ||
!persistedStoreState.disabledActions?.includes('tray-serve') ||
!persistedStoreState.disabledActions?.includes('tray-purge') ||
@@ -539,6 +525,20 @@ export async function buildMenu() {
if (allowsAdditional) {
const commandsSubmenuItems: (MenuItem | Submenu | PredefinedMenuItem)[] = []
if (!persistedStoreState.disabledActions?.includes('tray-sync')) {
const syncMenuItem = await MenuItem.new({
id: 'sync',
text: 'Sync',
action: async () => {
await openWindow({
name: 'Sync',
url: '/sync',
})
},
})
commandsSubmenuItems.push(syncMenuItem)
}
if (!persistedStoreState.disabledActions?.includes('tray-move')) {
const moveMenuItem = await MenuItem.new({
id: 'move',