Repository: gitify-app/gitify
Pull request #1200 (2024-06-08 10:42:36)

refactor: remove unused auth param


Patch:
diff --git a/README.md b/README.md
index 252e9dc8..1198e802 100644
--- a/README.md
+++ b/README.md
@@ -1,4 +1,4 @@
-# Gitify [![Build Workflow][build-workflow-badge]][github-actions] [![Release Workflow][release-workflow-badge]][github-actions] [![Coveralls][coveralls-badge]][coveralls] [![Renovate enabled][renovate-badge]][renovate] [![Contributors][contributors-badge]][github] [![Downloads - Total][downloads-total-badge]][website] [![Downloads - Latest Release][downloads-latest-badge]][website] [![OSS License][license-badge]][license] [![Latest Release][github-release-badge]][github-releases] [![Homebrew Cask][homebrew-cask-badge]][homebrew-cask]
+# Gitify [![Build Workflow][build-workflow-badge]][github-actions] [![Release Workflow][release-workflow-badge]][github-actions] [![Coveralls][coveralls-badge]][coveralls] [![Renovate enabled][renovate-badge]][renovate] [![Libraries.io dependency status][librariesio-badge]][librariesio] [![Contributors][contributors-badge]][github] [![Downloads - Total][downloads-total-badge]][website] [![Downloads - Latest Release][downloads-latest-badge]][website] [![OSS License][license-badge]][license] [![Latest Release][github-release-badge]][github-releases] [![Homebrew Cask][homebrew-cask-badge]][homebrew-cask]
 
 > GitHub Notifications on your menu bar. Available on macOS, Windows and Linux.
 
@@ -46,7 +46,9 @@ The release process is automated. Follow the steps below.
 
 ### Tests
 
-There are 2 checks - one for biome (linter & formatter) and one for the unit tests with `jest`.
+There are 2 checks:
+1. linter & formatter with [biome][biome-website]
+2. unit tests with [jest][jest-website]
 
 ```shell
 # Run biome to check linting and formatting
@@ -75,7 +77,8 @@ Please visit our [Gitify FAQs][faqs] for all commonly asked questions.
 
 ### License
 
-Gitify is licensed under the MIT Open Source license. For more information, see [LICENSE](LICENSE).
+Gitify is licensed under the MIT Open Source license. 
+For more information, see [LICENSE](LICENSE).
 
 
 <!-- LINK LABELS -->
@@ -89,6 +92,7 @@ Gitify is licensed under the MIT Open Source license. For more information, see
 [github-website-pulls]: https://github.com/gitify-app/website/pulls
 [brew]: http://brew.sh/
 [homebrew-cask]: https://formulae.brew.sh/cask/gitify
+[biome-website]: biomejs.dev/
 [coveralls]: https://coveralls.io/github/gitify-app/gitify
 [coveralls-badge]: https://img.shields.io/coverallsCoverage/github/gitify-app/gitify
 [build-workflow-badge]: https://github.com/gitify-app/gitify/actions/workflows/build-app.yml/badge.svg
@@ -96,9 +100,12 @@ Gitify is licensed under the MIT Open Source license. For more information, see
 [downloads-total-badge]: https://img.shields.io/github/downloads/gitify-app/gitify/total?label=downloads@all
 [downloads-latest-badge]: https://img.shields.io/github/downloads/gitify-app/gitify/latest/total
 [contributors-badge]: https://img.shields.io/github/contributors/gitify-app/gitify
+[librariesio]: https://libraries.io/
+[librariesio-badge]: https://img.shields.io/librariesio/github/gitify-app/gitify
 [license]: LICENSE
 [license-badge]: https://img.shields.io/github/license/gitify-app/gitify
 [github-release-badge]: https://img.shields.io/github/v/release/gitify-app/gitify
 [homebrew-cask-badge]: https://img.shields.io/homebrew/cask/v/gitify
+[jest-website]: https://jestjs.io/
 [renovate]: https://renovatebot.com/
 [renovate-badge]: https://img.shields.io/badge/renovate-enabled-brightgreen.svg
diff --git a/assets/images/tray-idleTemplate.png b/assets/images/tray-idle.png
similarity index 100%
rename from assets/images/tray-idleTemplate.png
rename to assets/images/tray-idle.png
diff --git a/assets/images/tray-idleTemplate@2x.png b/assets/images/tray-idle@2x.png
similarity index 100%
rename from assets/images/tray-idleTemplate@2x.png
rename to assets/images/tray-idle@2x.png
diff --git a/biome.json b/biome.json
index b14e36ec..b417c560 100644
--- a/biome.json
+++ b/biome.json
@@ -1,5 +1,5 @@
 {
-  "$schema": "https://biomejs.dev/schemas/1.8.0/schema.json",
+  "$schema": "https://biomejs.dev/schemas/1.8.1/schema.json",
   "organizeImports": {
     "enabled": true
   },
diff --git a/index.html b/index.html
index 1178f95c..7705d6ee 100644
--- a/index.html
+++ b/index.html
@@ -1,5 +1,5 @@
 <!doctype html>
-<html>
+<html lang="en">
   <head>
     <title>Gitify</title>
     <meta charset="utf-8" />
diff --git a/main.js b/main.js
index d0d76f0a..299475dd 100644
--- a/main.js
+++ b/main.js
@@ -6,12 +6,7 @@ const path = require('node:path');
 
 require('@electron/remote/main').initialize();
 
-const iconIdle = path.join(
-  __dirname,
-  'assets',
-  'images',
-  'tray-idleTemplate.png',
-);
+const iconIdle = path.join(__dirname, 'assets', 'images', 'tray-idle.png');
 const iconActive = path.join(__dirname, 'assets', 'images', 'tray-active.png');
 
 const browserWindowOpts = {
@@ -73,37 +68,39 @@ mb.on('ready', () => {
 
   nativeTheme.on('updated', () => {
     if (nativeTheme.shouldUseDarkColors) {
-      mb.window.webContents.send('update-native-theme', 'DARK');
+      mb.window.webContents.send('gitify:update-theme', 'DARK');
     } else {
-      mb.window.webContents.send('update-native-theme', 'LIGHT');
+      mb.window.webContents.send('gitify:update-theme', 'LIGHT');
     }
   });
+});
 
-  ipc.handle('get-app-version', () => app.getVersion());
+ipc.handle('gitify:version', () => app.getVersion());
 
-  ipc.on('reopen-window', () => mb.showWindow());
+ipc.on('gitify:window-show', () => mb.showWindow());
 
-  ipc.on('hide-window', () => mb.hideWindow());
+ipc.on('gitify:window-hide', () => mb.hideWindow());
 
-  ipc.on('app-quit', () => mb.app.quit());
+ipc.on('gitify:quit', () => mb.app.quit());
 
-  ipc.on('update-icon', (_, arg) => {
-    if (!mb.tray.isDestroyed()) {
-      if (arg === 'TrayActive') {
-        mb.tray.setImage(iconActive);
-      } else {
-        mb.tray.setImage(iconIdle);
-      }
-    }
-  });
+ipc.on('gitify:icon-active', () => {
+  if (!mb.tray.isDestroyed()) {
+    mb.tray.setImage(iconActive);
+  }
+});
 
-  ipc.on('update-title', (_, title) => {
-    if (!mb.tray.isDestroyed()) {
-      mb.tray.setTitle(title);
-    }
-  });
+ipc.on('gitify:icon-idle', () => {
+  if (!mb.tray.isDestroyed()) {
+    mb.tray.setImage(iconIdle);
+  }
+});
 
-  ipc.on('set-login-item-settings', (_, settings) => {
-    app.setLoginItemSettings(settings);
-  });
+ipc.on('gitify:update-title', (_, title) => {
+  if (!mb.tray.isDestroyed()) {
+    mb.tray.setTitle(title);
+  }
+});
+
+ipc.on('gitify:update-auto-launch', (_, settings) => {
+  app.setLoginItemSettings(settings);
 });
diff --git a/package.json b/package.json
index 7da24840..a22290b4 100644
--- a/package.json
+++ b/package.json
@@ -124,7 +124,7 @@
     "typescript": "5.4.5"
   },
   "devDependencies": {
-    "@biomejs/biome": "1.8.0",
+    "@biomejs/biome": "1.8.1",
     "@electron/notarize": "2.3.2",
     "@testing-library/react": "16.0.0",
     "@types/jest": "29.5.12",
@@ -153,7 +153,7 @@
     "webpack-cli": "5.1.4",
     "webpack-merge": "5.10.0"
   },
-  "packageManager": "pnpm@9.2.0",
+  "packageManager": "pnpm@9.3.0",
   "lint-staged": {
     "*.{html,js,json,ts,tsx}": "biome format --fix"
   }
diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml
index 316bb821..16ef5d76 100644
--- a/pnpm-lock.yaml
+++ b/pnpm-lock.yaml
@@ -55,8 +55,8 @@ importers:
         version: 5.4.5
     devDependencies:
       '@biomejs/biome':
-        specifier: 1.8.0
-        version: 1.8.0
+        specifier: 1.8.1
+        version: 1.8.1
       '@electron/notarize':
         specifier: 2.3.2
         version: 2.3.2
@@ -323,55 +323,55 @@ packages:
   '@bcoe/v8-coverage@0.2.3':
     resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==}
 
-  '@biomejs/biome@1.8.0':
-    resolution: {integrity: sha512-34xcE2z8GWrIz1sCFEmlHT/+4d+SN7YOqqvzlAKXKvaWPRJ2/NUwxPbRsP01P9QODkQ5bvGvc9rpBihmP+7RJQ==}
+  '@biomejs/biome@1.8.1':
+    resolution: {integrity: sha512-fQXGfvq6DIXem12dGQCM2tNF+vsNHH1qs3C7WeOu75Pd0trduoTmoO7G4ntLJ2qDs5wuw981H+cxQhi1uHnAtA==}
     engines: {node: '>=14.21.3'}
     hasBin: true
 
-  '@biomejs/cli-darwin-arm64@1.8.0':
-    resolution: {integrity: sha512-dBAYzfIJ1JmWigKlWourT3sJ3I60LZPjqNwwlsyFjiv5AV7vPeWlHVVIImV2BpINwNjZQhpXnwDfVnGS4vr7AA==}
+  '@biomejs/cli-darwin-arm64@1.8.1':
+    resolution: {integrity: sha512-XLiB7Uu6GALIOBWzQ2aMD0ru4Ly5/qSeQF7kk3AabzJ/kwsEWSe33iVySBP/SS2qv25cgqNiLksjGcw2bHT3mw==}
     engines: {node: '>=14.21.3'}
     cpu: [arm64]
     os: [darwin]
 
-  '@biomejs/cli-darwin-x64@1.8.0':
-    resolution: {integrity: sha512-ZTTSD0bP0nn9UpRDGQrQNTILcYSj+IkxTYr3CAV64DWBDtQBomlk2oVKWzDaA1LOhpAsTh0giLCbPJaVk2jfMQ==}
+  '@biomejs/cli-darwin-x64@1.8.1':
+    resolution: {integrity: sha512-uMTSxVLMfqkBVqyc25hSn83jBbp+wtWjzM/pHFlKXt3htJuw7FErVGW0nmQ9Sxa9vJ7GcqoltLMl28VQRIMYzg==}
     engines: {node: '>=14.21.3'}
     cpu: [x64]
     os: [darwin]
 
-  '@biomejs/cli-linux-arm64-musl@1.8.0':
-    resolution: {integrity: sha512-+ee/pZWsvhDv6eRI00krRNSgAg8DKSxzOv3LUsCjto6N1VzqatTASeQv2HRfG1nitf79rRKM75LkMJbqEfiKww==}
+  '@biomejs/cli-linux-arm64-musl@1.8.1':
+    resolution: {integrity: sha512-UQ8Wc01J0wQL+5AYOc7qkJn20B4PZmQL1KrmDZh7ot0DvD6aX4+8mmfd/dG5b6Zjo/44QvCKcvkFGCMRYuhWZA==}
     engines: {node: '>=14.21.3'}
     cpu: [arm64]
     os: [linux]
 
-  '@biomejs/cli-linux-arm64@1.8.0':
-    resolution: {integrity: sha512-cx725jTlJS6dskvJJwwCQaaMRBKE2Qss7ukzmx27Rn/DXRxz6tnnBix4FUGPf1uZfwrERkiJlbWM05JWzpvvXg==}
+  '@biomejs/cli-linux-arm64@1.8.1':
+    resolution: {integrity: sha512-3SzZRuC/9Oi2P2IBNPsEj0KXxSXUEYRR2kfRF/Ve8QAfGgrt4qnwuWd6QQKKN5R+oYH691qjm+cXBKEcrP1v/Q==}
     engines: {node: '>=14.21.3'}
     cpu: [arm64]
     os: [linux]
 
-  '@biomejs/cli-linux-x64-musl@1.8.0':
-    resolution: {integrity: sha512-VPA4ocrAOak50VYl8gOAVnjuFFDpIUolShntc/aWM0pZfSIMbRucxnrfUfp44EVwayxjK6ruJTR5xEWj93WvDA==}
+  '@biomejs/cli-linux-x64-musl@1.8.1':
+    resolution: {integrity: sha512-fYbP/kNu/rtZ4kKzWVocIdqZOtBSUEg9qUhZaao3dy3CRzafR6u6KDtBeSCnt47O+iLnks1eOR1TUxzr5+QuqA==}
     engines: {node: '>=14.21.3'}
     cpu: [x64]
     os: [linux]
 
-  '@biomejs/cli-linux-x64@1.8.0':
-    resolution: {integrity: sha512-cmgmhlD4QUxMhL1VdaNqnB81xBHb3R7huVNyYnPYzP+AykZ7XqJbPd1KcWAszNjUk2AHdx0aLKEBwCOWemxb2g==}
+  '@biomejs/cli-linux-x64@1.8.1':
+    resolution: {integrity: sha512-AeBycVdNrTzsyYKEOtR2R0Ph0hCD0sCshcp2aOnfGP0hCZbtFg09D0SdKLbyzKntisY41HxKVrydYiaApp+2uw==}
     engines: {node: '>=14.21.3'}
     cpu: [x64]
     os: [linux]
 
-  '@biomejs/cli-win32-arm64@1.8.0':
-    resolution: {integrity: sha512-J31spvlh39FfRHQacYXxJX9PvTCH/a8+2Jx9D1lxw+LSF0JybqZcw/4JrlFUWUl4kF3yv8AuYUK0sENScc3g9w==}
+  '@biomejs/cli-win32-arm64@1.8.1':
+    resolution: {integrity: sha512-6tEd1H/iFKpgpE3OIB7oNgW5XkjiVMzMRPL8zYoZ036YfuJ5nMYm9eB9H/y81+8Z76vL48fiYzMPotJwukGPqQ==}
     engines: {node: '>=14.21.3'}
     cpu: [arm64]
     os: [win32]
 
-  '@biomejs/cli-win32-x64@1.8.0':
-    resolution: {integrity: sha512-uPHHvu76JC1zYe9zZDcOU9PAg+1MZmPuNgWkb5jljaDeATvzLFPB+0nuJTilf603LXL+E8IdPQAO61Wy2VuEJA==}
+  '@biomejs/cli-win32-x64@1.8.1':
+    resolution: {integrity: sha512-g2H31jJzYmS4jkvl6TiyEjEX+Nv79a5km/xn+5DARTp5MBFzC9gwceusSSB2AkJKqZzY131AiACAWjKrVt5Ijw==}
     engines: {node: '>=14.21.3'}
     cpu: [x64]
     os: [win32]
@@ -3382,39 +3382,39 @@ snapshots:
 
   '@bcoe/v8-coverage@0.2.3': {}
 
-  '@biomejs/biome@1.8.0':
+  '@biomejs/biome@1.8.1':
     optionalDependencies:
-      '@biomejs/cli-darwin-arm64': 1.8.0
-      '@biomejs/cli-darwin-x64': 1.8.0
-      '@biomejs/cli-linux-arm64': 1.8.0
-      '@biomejs/cli-linux-arm64-musl': 1.8.0
-      '@biomejs/cli-linux-x64': 1.8.0
-      '@biomejs/cli-linux-x64-musl': 1.8.0
-      '@biomejs/cli-win32-arm64': 1.8.0
-      '@biomejs/cli-win32-x64': 1.8.0
-
-  '@biomejs/cli-darwin-arm64@1.8.0':
+      '@biomejs/cli-darwin-arm64': 1.8.1
+      '@biomejs/cli-darwin-x64': 1.8.1
+      '@biomejs/cli-linux-arm64': 1.8.1
+      '@biomejs/cli-linux-arm64-musl': 1.8.1
+      '@biomejs/cli-linux-x64': 1.8.1
+      '@biomejs/cli-linux-x64-musl': 1.8.1
+      '@biomejs/cli-win32-arm64': 1.8.1
+      '@biomejs/cli-win32-x64': 1.8.1
+
+  '@biomejs/cli-darwin-arm64@1.8.1':
     optional: true
 
-  '@biomejs/cli-darwin-x64@1.8.0':
+  '@biomejs/cli-darwin-x64@1.8.1':
     optional: true
 
-  '@biomejs/cli-linux-arm64-musl@1.8.0':
+  '@biomejs/cli-linux-arm64-musl@1.8.1':
     optional: true
 
-  '@biomejs/cli-linux-arm64@1.8.0':
+  '@biomejs/cli-linux-arm64@1.8.1':
     optional: true
 
-  '@biomejs/cli-linux-x64-musl@1.8.0':
+  '@biomejs/cli-linux-x64-musl@1.8.1':
     optional: true
 
-  '@biomejs/cli-linux-x64@1.8.0':
+  '@biomejs/cli-linux-x64@1.8.1':
     optional: true
 
-  '@biomejs/cli-win32-arm64@1.8.0':
+  '@biomejs/cli-win32-arm64@1.8.1':
     optional: true
 
-  '@biomejs/cli-win32-x64@1.8.0':
+  '@biomejs/cli-win32-x64@1.8.1':
     optional: true
 
   '@cspotcode/source-map-support@0.8.1':
diff --git a/src/__mocks__/electron.js b/src/__mocks__/electron.js
index 25a226c1..89c50b41 100644
--- a/src/__mocks__/electron.js
+++ b/src/__mocks__/electron.js
@@ -36,7 +36,7 @@ module.exports = {
       switch (channel) {
         case 'get-platform':
           return Promise.resolve('darwin');
-        case 'get-app-version':
+        case 'gitify:version':
           return Promise.resolve('0.0.1');
         default:
           return Promise.reject(new Error(`Unknown channel: ${channel}`));
diff --git a/src/components/Repository.tsx b/src/components/Repository.tsx
index 2b787761..fc66fa33 100644
--- a/src/components/Repository.tsx
+++ b/src/components/Repository.tsx
@@ -17,7 +17,7 @@ export const RepositoryNotifications: FC<IProps> = ({
   repoNotifications,
   hostname,
 }) => {
-  const { markRepoNotifications, markRepoNotificationsDone } =
+  const { markRepoNotificationsRead, markRepoNotificationsDone } =
     useContext(AppContext);
 
   const openBrowser = useCallback(() => {
@@ -27,7 +27,7 @@ export const RepositoryNotifications: FC<IProps> = ({
 
   const markRepoAsRead = useCallback(() => {
     const repoSlug = repoNotifications[0].repository.full_name;
-    markRepoNotifications(repoSlug, hostname);
+    markRepoNotificationsRead(repoSlug, hostname);
   }, [repoNotifications, hostname]);
 
   const markRepoAsDone = useCallback(() => {
diff --git a/src/components/Sidebar.tsx b/src/components/Sidebar.tsx
index 927d59f0..a6f10faa 100644
--- a/src/components/Sidebar.tsx
+++ b/src/components/Sidebar.tsx
@@ -4,12 +4,11 @@ import {
   SyncIcon,
   XCircleIcon,
 } from '@primer/octicons-react';
-import { ipcRenderer } from 'electron';
 import { type FC, useCallback, useContext, useMemo } from 'react';
 import { useLocation, useNavigate } from 'react-router-dom';
 import { Logo } from '../components/Logo';
 import { AppContext } from '../context/App';
-import { openExternalLink } from '../utils/comms';
+import { openExternalLink, quitApp } from '../utils/comms';
 import { Constants } from '../utils/constants';
 import { getNotificationCount } from '../utils/notifications';
 
@@ -28,10 +27,6 @@ export const Sidebar: FC = () => {
     openExternalLink('https://github.com/notifications');
   }, []);
 
-  const quitApp = useCallback(() => {
-    ipcRenderer.send('app-quit');
-  }, []);
-
   const toggleSettings = () => {
     if (location.pathname.startsWith('/settings')) {
       navigate('/', { replace: true });
diff --git a/src/context/App.tsx b/src/context/App.tsx
index 6f138eae..6ff3a1f1 100644
--- a/src/context/App.tsx
+++ b/src/context/App.tsx
@@ -79,7 +79,7 @@ interface AppContextState {
   markNotificationRead: (id: string, hostname: string) => Promise<void>;
   markNotificationDone: (id: string, hostname: string) => Promise<void>;
   unsubscribeNotification: (id: string, hostname: string) => Promise<void>;
-  markRepoNotifications: (id: string, hostname: string) => Promise<void>;
+  markRepoNotificationsRead: (id: string, hostname: string) => Promise<void>;
   markRepoNotificationsDone: (id: string, hostname: string) => Promise<void>;
 
   settings: SettingsState;
@@ -103,7 +103,7 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
     markNotificationRead,
     markNotificationDone,
     unsubscribeNotification,
-    markRepoNotifications,
+    markRepoNotificationsRead,
     markRepoNotificationsDone,
   } = useNotifications();
 
@@ -112,7 +112,7 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
   }, []);
 
   useEffect(() => {
-    setTheme(settings.theme as Theme);
+    setTheme(settings.theme);
   }, [settings.theme]);
 
   // biome-ignore lint/correctness/useExhaustiveDependencies: We only want fetchNotifications to be called for certain account or setting changes.
@@ -248,9 +248,9 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
     [auth, notifications],
   );
 
-  const markRepoNotificationsWithAccounts = useCallback(
+  const markRepoNotificationsReadWithAccounts = useCallback(
     async (repoSlug: string, hostname: string) =>
-      await markRepoNotifications({ auth, settings }, repoSlug, hostname),
+      await markRepoNotificationsRead({ auth, settings }, repoSlug, hostname),
     [auth, notifications],
   );
 
@@ -279,7 +279,7 @@ export const AppProvider = ({ children }: { children: ReactNode }) => {
         markNotificationRead: markNotificationReadWithAccounts,
         markNotificationDone: markNotificationDoneWithAccounts,
         unsubscribeNotification: unsubscribeNotificationWithAccounts,
-        markRepoNotifications: markRepoNotificationsWithAccounts,
+        markRepoNotificationsRead: markRepoNotificationsReadWithAccounts,
         markRepoNotificationsDone: markRepoNotificationsDoneWithAccounts,
 
         settings,
diff --git a/src/hooks/useNotifications.ts b/src/hooks/useNotifications.ts
index 7dd93dff..2dc51884 100644
--- a/src/hooks/useNotifications.ts
+++ b/src/hooks/useNotifications.ts
@@ -45,7 +45,7 @@ interface NotificationsState {
     id: string,
     hostname: string,
   ) => Promise<void>;
-  markRepoNotifications: (
+  markRepoNotificationsRead: (
     state: GitifyState,
     repoSlug: string,
     hostname: string,
@@ -154,7 +154,7 @@ export const useNotifications = (): NotificationsState => {
     [notifications],
   );
 
-  const markRepoNotifications = useCallback(
+  const markRepoNotificationsRead = useCallback(
     async (state: GitifyState, repoSlug: string, hostname: string) => {
       setStatus('loading');
 
@@ -251,7 +251,7 @@ export const useNotifications = (): NotificationsState => {
     markNotificationRead,
     markNotificationDone,
     unsubscribeNotification,
-    markRepoNotifications,
+    markRepoNotificationsRead,
     markRepoNotificationsDone,
   };
 };
diff --git a/src/routes/Login.tsx b/src/routes/Login.tsx
index 8e70f9f3..f33acab4 100644
--- a/src/routes/Login.tsx
+++ b/src/routes/Login.tsx
@@ -1,10 +1,10 @@
 import { KeyIcon, PersonIcon } from '@primer/octicons-react';
-import { ipcRenderer } from 'electron';
 import { type FC, useContext, useEffect } from 'react';
 import { useNavigate } from 'react-router-dom';
 import { Logo } from '../components/Logo';
 import { Button } from '../components/fields/Button';
 import { AppContext } from '../context/App';
+import { showWindow } from '../utils/comms';
 
 export const LoginRoute: FC = () => {
   const navigate = useNavigate();
@@ -12,7 +12,7 @@ export const LoginRoute: FC = () => {
 
   useEffect(() => {
     if (isLoggedIn) {
-      ipcRenderer.send('reopen-window');
+      showWindow();
       navigate('/', { replace: true });
     }
   }, [isLoggedIn]);
diff --git a/src/routes/Settings.tsx b/src/routes/Settings.tsx
index dec907f2..31c75b65 100644
--- a/src/routes/Settings.tsx
+++ b/src/routes/Settings.tsx
@@ -22,7 +22,7 @@ import { Checkbox } from '../components/fields/Checkbox';
 import { RadioGroup } from '../components/fields/RadioGroup';
 import { AppContext } from '../context/App';
 import { Theme } from '../types';
-import { openExternalLink } from '../utils/comms';
+import { getAppVersion, openExternalLink, quitApp } from '../utils/comms';
 import Constants from '../utils/constants';
 import { isLinux, isMacOS } from '../utils/platform';
 import { setTheme } from '../utils/theme';
@@ -50,20 +50,16 @@ export const SettingsRoute: FC = () => {
 
   useEffect(() => {
     (async () => {
-      const result = await ipcRenderer.invoke('get-app-version');
+      const result = await getAppVersion();
       setAppVersion(result);
     })();
 
-    ipcRenderer.on('update-native-theme', (_, updatedTheme: Theme) => {
+    ipcRenderer.on('gitify:update-theme', (_, updatedTheme: Theme) => {
       if (settings.theme === Theme.SYSTEM) {
         setTheme(updatedTheme);
       }
     });
-  }, []);
-
-  const quitApp = useCallback(() => {
-    ipcRenderer.send('app-quit');
-  }, []);
+  }, [settings.theme]);
 
   const footerButtonClass =
     'hover:text-gray-500 py-1 px-2 my-1 mx-2 focus:outline-none';
diff --git a/src/utils/comms.ts b/src/utils/comms.ts
index 3bfa0964..0e67746a 100644
--- a/src/utils/comms.ts
+++ b/src/utils/comms.ts
@@ -6,8 +6,24 @@ export function openExternalLink(url: string): void {
   }
 }
 
+export async function getAppVersion(): Promise<string> {
+  return await ipcRenderer.invoke('gitify:version');
+}
+
+export function quitApp(): void {
+  ipcRenderer.send('gitify:quit');
+}
+
+export function showWindow(): void {
+  ipcRenderer.send('gitify:window-show');
+}
+
+export function hideWindow(): void {
+  ipcRenderer.send('gitify:window-hide');
+}
+
 export function setAutoLaunch(value: boolean): void {
-  ipcRenderer.send('set-login-item-settings', {
+  ipcRenderer.send('gitify:update-auto-launch', {
     openAtLogin: value,
     openAsHidden: value,
   });
@@ -15,16 +31,12 @@ export function setAutoLaunch(value: boolean): void {
 
 export function updateTrayIcon(notificationsLength = 0): void {
   if (notificationsLength > 0) {
-    ipcRenderer.send('update-icon', 'TrayActive');
+    ipcRenderer.send('gitify:icon-active');
   } else {
-    ipcRenderer.send('update-icon');
+    ipcRenderer.send('gitify:icon-idle');
   }
 }
 
 export function updateTrayTitle(title = ''): void {
-  ipcRenderer.send('update-title', title);
-}
-
-export function restoreSetting(setting, value): void {
-  ipcRenderer.send(setting, value);
+  ipcRenderer.send('gitify:update-title', title);
 }
diff --git a/src/utils/notifications.ts b/src/utils/notifications.ts
index f2e3bbc8..2c5f2f49 100644
--- a/src/utils/notifications.ts
+++ b/src/utils/notifications.ts
@@ -1,14 +1,12 @@
-import { ipcRenderer } from 'electron';
 import type {
   AccountNotifications,
-  AuthState,
   GitifyState,
   SettingsState,
 } from '../types';
 import { Notification } from '../typesGitHub';
 import { openInBrowser } from '../utils/helpers';
 import { listNotificationsForAuthenticatedUser } from './api/client';
-import { updateTrayIcon } from './comms';
+import { hideWindow, showWindow, updateTrayIcon } from './comms';
 import { isWindows } from './platform';
 import { getGitifySubjectDetails } from './subject';
 
@@ -66,14 +64,11 @@ export const triggerNativeNotifications = (
   }
 
   if (state.settings.showNotifications) {
-    raiseNativeNotification(diffNotifications, state.auth);
+    raiseNativeNotification(diffNotifications);
   }
 };
 
-export const raiseNativeNotification = (
-  notifications: Notification[],
-  auth: AuthState,
-) => {
+export const raiseNativeNotification = (notifications: Notification[]) => {
   let title: string;
   let body: string;
 
@@ -95,10 +90,10 @@ export const raiseNativeNotification = (
 
   nativeNotification.onclick = () => {
     if (notifications.length === 1) {
-      ipcRenderer.send('hide-window');
+      hideWindow();
       openInBrowser(notifications[0]);
     } else {
-      ipcRenderer.send('reopen-window');
+      showWindow();
     }
   };
 


Test patch:
diff --git a/src/components/Repository.test.tsx b/src/components/Repository.test.tsx
index 888e7658..0e539cc0 100644
--- a/src/components/Repository.test.tsx
+++ b/src/components/Repository.test.tsx
@@ -9,7 +9,7 @@ jest.mock('./NotificationRow', () => ({
 }));
 
 describe('components/Repository.tsx', () => {
-  const markRepoNotifications = jest.fn();
+  const markRepoNotificationsRead = jest.fn();
   const markRepoNotificationsDone = jest.fn();
 
   const props = {
@@ -19,7 +19,7 @@ describe('components/Repository.tsx', () => {
   };
 
   beforeEach(() => {
-    markRepoNotifications.mockReset();
+    markRepoNotificationsRead.mockReset();
 
     jest.spyOn(shell, 'openExternal');
   });
@@ -50,14 +50,14 @@ describe('components/Repository.tsx', () => {
 
   it('should mark a repo as read', () => {
     render(
-      <AppContext.Provider value={{ markRepoNotifications }}>
+      <AppContext.Provider value={{ markRepoNotificationsRead }}>
         <RepositoryNotifications {...props} />
       </AppContext.Provider>,
     );
 
     fireEvent.click(screen.getByTitle('Mark Repository as Read'));
 
-    expect(markRepoNotifications).toHaveBeenCalledWith(
+    expect(markRepoNotificationsRead).toHaveBeenCalledWith(
       'gitify-app/notifications-test',
       'github.com',
     );
diff --git a/src/components/Sidebar.test.tsx b/src/components/Sidebar.test.tsx
index a100c21c..216114ce 100644
--- a/src/components/Sidebar.test.tsx
+++ b/src/components/Sidebar.test.tsx
@@ -1,9 +1,10 @@
 import { fireEvent, render, screen } from '@testing-library/react';
-import { ipcRenderer, shell } from 'electron';
+import { shell } from 'electron';
 import { MemoryRouter } from 'react-router-dom';
 import { mockAccountNotifications } from '../__mocks__/notifications-mocks';
 import { mockSettings } from '../__mocks__/state-mocks';
 import { AppContext } from '../context/App';
+import * as comms from '../utils/comms';
 import { Sidebar } from './Sidebar';
 
 const mockNavigate = jest.fn();
@@ -18,7 +19,6 @@ describe('components/Sidebar.tsx', () => {
   beforeEach(() => {
     fetchNotifications.mockReset();
 
-    jest.spyOn(ipcRenderer, 'send');
     jest.spyOn(shell, 'openExternal');
     jest.spyOn(window, 'clearInterval');
   });
@@ -147,6 +147,8 @@ describe('components/Sidebar.tsx', () => {
   });
 
   it('should quit the app', () => {
+    const quitAppMock = jest.spyOn(comms, 'quitApp');
+
     render(
       <AppContext.Provider value={{ isLoggedIn: false, notifications: [] }}>
         <MemoryRouter>
@@ -155,8 +157,7 @@ describe('components/Sidebar.tsx', () => {
       </AppContext.Provider>,
     );
     fireEvent.click(screen.getByTitle('Quit Gitify'));
-    expect(ipcRenderer.send).toHaveBeenCalledTimes(1);
-    expect(ipcRenderer.send).toHaveBeenCalledWith('app-quit');
+    expect(quitAppMock).toHaveBeenCalledTimes(1);
   });
 
   it('should open the gitify repository', () => {
diff --git a/src/context/App.test.tsx b/src/context/App.test.tsx
index 5773b80e..23adaed9 100644
--- a/src/context/App.test.tsx
+++ b/src/context/App.test.tsx
@@ -45,7 +45,7 @@ describe('context/App.tsx', () => {
     const markNotificationReadMock = jest.fn();
     const markNotificationDoneMock = jest.fn();
     const unsubscribeNotificationMock = jest.fn();
-    const markRepoNotificationsMock = jest.fn();
+    const markRepoNotificationsReadMock = jest.fn();
     const markRepoNotificationsDoneMock = jest.fn();
 
     const mockDefaultState = {
@@ -59,7 +59,7 @@ describe('context/App.tsx', () => {
         markNotificationRead: markNotificationReadMock,
         markNotificationDone: markNotificationDoneMock,
         unsubscribeNotification: unsubscribeNotificationMock,
-        markRepoNotifications: markRepoNotificationsMock,
+        markRepoNotificationsRead: markRepoNotificationsReadMock,
         markRepoNotificationsDone: markRepoNotificationsDoneMock,
       });
     });
@@ -198,15 +198,15 @@ describe('context/App.tsx', () => {
       );
     });
 
-    it('should call markRepoNotifications', async () => {
+    it('should call markRepoNotificationsRead', async () => {
       const TestComponent = () => {
-        const { markRepoNotifications } = useContext(AppContext);
+        const { markRepoNotificationsRead } = useContext(AppContext);
 
         return (
           <button
             type="button"
             onClick={() =>
-              markRepoNotifications(
+              markRepoNotificationsRead(
                 'gitify-app/notifications-test',
                 'github.com',
               )
@@ -219,12 +219,12 @@ describe('context/App.tsx', () => {
 
       const { getByText } = customRender(<TestComponent />);
 
-      markRepoNotificationsMock.mockReset();
+      markRepoNotificationsReadMock.mockReset();
 
       fireEvent.click(getByText('Test Case'));
 
-      expect(markRepoNotificationsMock).toHaveBeenCalledTimes(1);
-      expect(markRepoNotificationsMock).toHaveBeenCalledWith(
+      expect(markRepoNotificationsReadMock).toHaveBeenCalledTimes(1);
+      expect(markRepoNotificationsReadMock).toHaveBeenCalledWith(
         mockDefaultState,
         'gitify-app/notifications-test',
         'github.com',
diff --git a/src/hooks/useNotifications.test.ts b/src/hooks/useNotifications.test.ts
index 04973282..fe562e38 100644
--- a/src/hooks/useNotifications.test.ts
+++ b/src/hooks/useNotifications.test.ts
@@ -467,7 +467,7 @@ describe('hooks/useNotifications.ts', () => {
     });
   });
 
-  describe('markRepoNotifications', () => {
+  describe('markRepoNotificationsRead', () => {
     const hostname = 'github.com';
     const repoSlug = 'gitify-app/notifications-test';
 
@@ -479,7 +479,7 @@ describe('hooks/useNotifications.ts', () => {
       const { result } = renderHook(() => useNotifications());
 
       act(() => {
-        result.current.markRepoNotifications(mockState, repoSlug, hostname);
+        result.current.markRepoNotificationsRead(mockState, repoSlug, hostname);
       });
 
       await waitFor(() => {
@@ -497,7 +497,7 @@ describe('hooks/useNotifications.ts', () => {
       const { result } = renderHook(() => useNotifications());
 
       act(() => {
-        result.current.markRepoNotifications(mockState, repoSlug, hostname);
+        result.current.markRepoNotificationsRead(mockState, repoSlug, hostname);
       });
 
       await waitFor(() => {
diff --git a/src/routes/Accounts.test.tsx b/src/routes/Accounts.test.tsx
index 1693605a..d8d99dc6 100644
--- a/src/routes/Accounts.test.tsx
+++ b/src/routes/Accounts.test.tsx
@@ -1,5 +1,5 @@
 import { act, fireEvent, render, screen } from '@testing-library/react';
-import { ipcRenderer, shell } from 'electron';
+import { shell } from 'electron';
 import { MemoryRouter } from 'react-router-dom';
 import {
   mockAuth,
@@ -9,6 +9,7 @@ import {
   mockSettings,
 } from '../__mocks__/state-mocks';
 import { AppContext } from '../context/App';
+import * as comms from '../utils/comms';
 import { AccountsRoute } from './Accounts';
 
 const mockNavigate = jest.fn();
@@ -148,6 +149,9 @@ describe('routes/Accounts.tsx', () => {
 
     it('should logout', async () => {
       const logoutFromAccountMock = jest.fn();
+      const updateTrayIconMock = jest.spyOn(comms, 'updateTrayIcon');
+      const updateTrayTitleMock = jest.spyOn(comms, 'updateTrayTitle');
+
       await act(async () => {
         render(
           <AppContext.Provider
@@ -170,9 +174,10 @@ describe('routes/Accounts.tsx', () => {
 
       expect(logoutFromAccountMock).toHaveBeenCalledTimes(1);
 
-      expect(ipcRenderer.send).toHaveBeenCalledTimes(2);
-      expect(ipcRenderer.send).toHaveBeenCalledWith('update-icon');
-      expect(ipcRenderer.send).toHaveBeenCalledWith('update-title', '');
+      expect(updateTrayIconMock).toHaveBeenCalledTimes(1);
+      expect(updateTrayIconMock).toHaveBeenCalledWith();
+      expect(updateTrayTitleMock).toHaveBeenCalledTimes(1);
+      expect(updateTrayTitleMock).toHaveBeenCalledWith();
       expect(mockNavigate).toHaveBeenNthCalledWith(1, -1);
     });
   });
diff --git a/src/routes/Login.test.tsx b/src/routes/Login.test.tsx
index d6d06463..8c985552 100644
--- a/src/routes/Login.test.tsx
+++ b/src/routes/Login.test.tsx
@@ -1,7 +1,7 @@
 import { fireEvent, render, screen } from '@testing-library/react';
-import { ipcRenderer } from 'electron';
 import { MemoryRouter } from 'react-router-dom';
 import { AppContext } from '../context/App';
+import * as comms from '../utils/comms';
 import { LoginRoute } from './Login';
 
 const mockNavigate = jest.fn();
@@ -13,7 +13,6 @@ jest.mock('react-router-dom', () => ({
 describe('routes/Login.tsx', () => {
   beforeEach(() => {
     mockNavigate.mockReset();
-    jest.spyOn(ipcRenderer, 'send');
   });
 
   it('should render itself & its children', () => {
@@ -27,6 +26,8 @@ describe('routes/Login.tsx', () => {
   });
 
   it('should redirect to notifications once logged in', () => {
+    const showWindowMock = jest.spyOn(comms, 'showWindow');
+
     const { rerender } = render(
       <AppContext.Provider value={{ isLoggedIn: false }}>
         <MemoryRouter>
@@ -43,8 +44,7 @@ describe('routes/Login.tsx', () => {
       </AppContext.Provider>,
     );
 
-    expect(ipcRenderer.send).toHaveBeenCalledTimes(1);
-    expect(ipcRenderer.send).toHaveBeenCalledWith('reopen-window');
+    expect(showWindowMock).toHaveBeenCalledTimes(1);
     expect(mockNavigate).toHaveBeenNthCalledWith(1, '/', { replace: true });
   });
 
diff --git a/src/routes/Settings.test.tsx b/src/routes/Settings.test.tsx
index a254d8bb..814da7a8 100644
--- a/src/routes/Settings.test.tsx
+++ b/src/routes/Settings.test.tsx
@@ -1,9 +1,10 @@
 import { act, fireEvent, render, screen } from '@testing-library/react';
-import { ipcRenderer, shell } from 'electron';
+import { shell } from 'electron';
 import { MemoryRouter } from 'react-router-dom';
 import { mockAuth, mockSettings } from '../__mocks__/state-mocks';
 import { mockPlatform } from '../__mocks__/utils';
 import { AppContext } from '../context/App';
+import * as comms from '../utils/comms';
 import { SettingsRoute } from './Settings';
 
 const mockNavigate = jest.fn();
@@ -524,6 +525,8 @@ describe('routes/Settings.tsx', () => {
     });
 
     it('should quit the app', async () => {
+      const quitAppMock = jest.spyOn(comms, 'quitApp');
+
       await act(async () => {
         render(
           <AppContext.Provider
@@ -540,7 +543,7 @@ describe('routes/Settings.tsx', () => {
       });
 
       fireEvent.click(screen.getByTitle('Quit Gitify'));
-      expect(ipcRenderer.send).toHaveBeenCalledWith('app-quit');
+      expect(quitAppMock).toHaveBeenCalledTimes(1);
     });
   });
 });
diff --git a/src/utils/comms.test.ts b/src/utils/comms.test.ts
index d00bde6f..2fa6cb88 100644
--- a/src/utils/comms.test.ts
+++ b/src/utils/comms.test.ts
@@ -1,38 +1,60 @@
 import { ipcRenderer, shell } from 'electron';
 import {
+  getAppVersion,
+  hideWindow,
   openExternalLink,
-  restoreSetting,
+  quitApp,
   setAutoLaunch,
+  showWindow,
   updateTrayIcon,
 } from './comms';
 
 describe('utils/comms.ts', () => {
   beforeEach(() => {
     jest.spyOn(ipcRenderer, 'send');
+    jest.spyOn(ipcRenderer, 'invoke');
   });
 
   afterEach(() => {
     jest.clearAllMocks();
   });
 
+  it('should get app version', async () => {
+    await getAppVersion();
+    expect(ipcRenderer.invoke).toHaveBeenCalledTimes(1);
+    expect(ipcRenderer.invoke).toHaveBeenCalledWith('gitify:version');
+  });
+
+  it('should quit the app', () => {
+    quitApp();
+    expect(ipcRenderer.send).toHaveBeenCalledTimes(1);
+    expect(ipcRenderer.send).toHaveBeenCalledWith('gitify:quit');
+  });
+
+  it('should show the window', () => {
+    showWindow();
+    expect(ipcRenderer.send).toHaveBeenCalledTimes(1);
+    expect(ipcRenderer.send).toHaveBeenCalledWith('gitify:window-show');
+  });
+
+  it('should hide the window', () => {
+    hideWindow();
+    expect(ipcRenderer.send).toHaveBeenCalledTimes(1);
+    expect(ipcRenderer.send).toHaveBeenCalledWith('gitify:window-hide');
+  });
+
   it('should send mark the icons as active', () => {
     const notificationsLength = 3;
     updateTrayIcon(notificationsLength);
     expect(ipcRenderer.send).toHaveBeenCalledTimes(1);
-    expect(ipcRenderer.send).toHaveBeenCalledWith('update-icon', 'TrayActive');
+    expect(ipcRenderer.send).toHaveBeenCalledWith('gitify:icon-active');
   });
 
   it('should send mark the icons as idle', () => {
     const notificationsLength = 0;
     updateTrayIcon(notificationsLength);
     expect(ipcRenderer.send).toHaveBeenCalledTimes(1);
-    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');
+    expect(ipcRenderer.send).toHaveBeenCalledWith('gitify:icon-idle');
   });
 
   it('should open an external link', () => {
@@ -49,7 +71,7 @@ describe('utils/comms.ts', () => {
   it('should setAutoLaunch (true)', () => {
     setAutoLaunch(true);
 
-    expect(ipcRenderer.send).toHaveBeenCalledWith('set-login-item-settings', {
+    expect(ipcRenderer.send).toHaveBeenCalledWith('gitify:update-auto-launch', {
       openAtLogin: true,
       openAsHidden: true,
     });
@@ -58,7 +80,7 @@ describe('utils/comms.ts', () => {
   it('should setAutoLaunch (false)', () => {
     setAutoLaunch(false);
 
-    expect(ipcRenderer.send).toHaveBeenCalledWith('set-login-item-settings', {
+    expect(ipcRenderer.send).toHaveBeenCalledWith('gitify:update-auto-launch', {
       openAsHidden: false,
       openAtLogin: false,
     });
diff --git a/src/utils/notifications.test.ts b/src/utils/notifications.test.ts
index 128c22c6..2979ce4c 100644
--- a/src/utils/notifications.test.ts
+++ b/src/utils/notifications.test.ts
@@ -1,5 +1,3 @@
-import { ipcRenderer } from 'electron';
-
 import {
   mockAccountNotifications,
   mockSingleAccountNotifications,
@@ -9,6 +7,7 @@ import { mockAuth, mockSettings } from '../__mocks__/state-mocks';
 import { defaultSettings } from '../context/App';
 import type { SettingsState } from '../types';
 import { mockGitHubNotifications } from './api/__mocks__/response-mocks';
+import * as comms from './comms';
 import * as helpers from './helpers';
 import * as notificationsHelpers from './notifications';
 import { filterNotifications } from './notifications';
@@ -112,30 +111,31 @@ describe('utils/notifications.ts', () => {
   });
 
   it('should click on a native notification (with 1 notification)', () => {
+    const hideWindowMock = jest.spyOn(comms, 'hideWindow');
     jest.spyOn(helpers, 'openInBrowser');
 
     const nativeNotification: Notification =
-      notificationsHelpers.raiseNativeNotification(
-        [mockGitHubNotifications[0]],
-        mockAuth,
-      );
+      notificationsHelpers.raiseNativeNotification([
+        mockGitHubNotifications[0],
+      ]);
     nativeNotification.onclick(null);
 
     expect(helpers.openInBrowser).toHaveBeenCalledTimes(1);
     expect(helpers.openInBrowser).toHaveBeenLastCalledWith(
       mockGitHubNotifications[0],
     );
-    expect(ipcRenderer.send).toHaveBeenCalledWith('hide-window');
+    expect(hideWindowMock).toHaveBeenCalledTimes(1);
   });
 
   it('should click on a native notification (with more than 1 notification)', () => {
+    const showWindowMock = jest.spyOn(comms, 'showWindow');
+
     const nativeNotification = notificationsHelpers.raiseNativeNotification(
       mockGitHubNotifications,
-      mockAuth,
     );
     nativeNotification.onclick(null);
 
-    expect(ipcRenderer.send).toHaveBeenCalledWith('reopen-window');
+    expect(showWindowMock).toHaveBeenCalledTimes(1);
   });
 
   it('should play a sound', () => {