Skip to content

Commit

Permalink
refactor: remove unused restoreSetting fn
Browse files Browse the repository at this point in the history
  • Loading branch information
setchy committed Jun 8, 2024
1 parent 291f35b commit d29e630
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 16 deletions.
13 changes: 1 addition & 12 deletions src/utils/comms.test.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,5 @@
import { ipcRenderer, shell } from 'electron';
import {
openExternalLink,
restoreSetting,
setAutoLaunch,
updateTrayIcon,
} from './comms';
import { openExternalLink, setAutoLaunch, updateTrayIcon } from './comms';

describe('utils/comms.ts', () => {
beforeEach(() => {
Expand All @@ -29,12 +24,6 @@ describe('utils/comms.ts', () => {
expect(ipcRenderer.send).toHaveBeenCalledWith('update-icon');
});

it('should restore a setting', () => {
restoreSetting('foo', 'bar');
expect(ipcRenderer.send).toHaveBeenCalledTimes(1);
expect(ipcRenderer.send).toHaveBeenCalledWith('foo', 'bar');
});

it('should open an external link', () => {
openExternalLink('http://www.gitify.io/');
expect(shell.openExternal).toHaveBeenCalledTimes(1);
Expand Down
4 changes: 0 additions & 4 deletions src/utils/comms.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,3 @@ export function updateTrayIcon(notificationsLength = 0): void {
export function updateTrayTitle(title = ''): void {
ipcRenderer.send('update-title', title);
}

export function restoreSetting(setting, value): void {
ipcRenderer.send(setting, value);
}

0 comments on commit d29e630

Please sign in to comment.