From 4d55ac941fd626ab0d98295809aa8d299b5e03ff Mon Sep 17 00:00:00 2001 From: Molunerfinn Date: Tue, 26 Jun 2018 17:12:21 +0800 Subject: [PATCH] Fixed: updateDefaultPicBed bug --- src/main/index.js | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/main/index.js b/src/main/index.js index d7d5f626..ef5030ad 100644 --- a/src/main/index.js +++ b/src/main/index.js @@ -385,14 +385,18 @@ ipcMain.on('updateCustomLink', (evt, oldLink) => { }) ipcMain.on('updateDefaultPicBed', (evt) => { - const types = picBed.map(item => item.type) - let submenuItem = contextMenu.items[2].submenu.items - submenuItem.forEach((item, index) => { - const result = db.read().get('picBed.current').value() === types[index] - if (result) { - item.click() // It's a bug which can not set checked status - } - }) + if (process.platform === 'darwin' || process.platform === 'win32') { + const types = picBed.map(item => item.type) + let submenuItem = contextMenu.items[2].submenu.items + submenuItem.forEach((item, index) => { + const result = db.read().get('picBed.current').value() === types[index] + if (result) { + item.click() // It's a bug which can not set checked status + } + }) + } else { + return false + } }) ipcMain.on('autoStart', (evt, val) => {