Skip to content

Commit

Permalink
Fix platform fetching issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendan Mulholland committed Oct 3, 2023
1 parent 46d82b4 commit 81a8748
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions main.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ menubarApp.on('ready', () => {
}
}
});
ipcMain.on('get-platform', (event) => {
event.returnValue = process.platform;
});

menubarApp.window.webContents.on('devtools-opened', () => {
menubarApp.window.setSize(800, 600);
Expand Down
1 change: 1 addition & 0 deletions src/__mocks__/electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module.exports = {
ipcRenderer: {
send: jest.fn(),
on: jest.fn(),
sendSync: () => 'darwin',
},
shell: {
openExternal: jest.fn(),
Expand Down
3 changes: 2 additions & 1 deletion src/routes/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@ import { IconQuit } from '../icons/Quit';
import { updateTrayIcon } from '../utils/comms';
import { setAppearance } from '../utils/appearance';

const isLinux = remote.process.platform === 'linux';
const platform = ipcRenderer.sendSync('get-platform');
const isLinux = platform === 'linux';

export const SettingsRoute: React.FC = () => {
const { settings, updateSetting, logout } = useContext(AppContext);
Expand Down

0 comments on commit 81a8748

Please sign in to comment.