]> Repos - mime-chat/commitdiff
fix: remove unused code from preload and config icons
authorriqo <hernandeze2@xavier.edu>
Sun, 1 Aug 2021 17:10:10 +0000 (12:10 -0500)
committerriqo <hernandeze2@xavier.edu>
Sun, 1 Aug 2021 17:10:10 +0000 (12:10 -0500)
src/config.ts
src/main.ts
src/render/preload.ts
src/tray.ts

index ceab21fadb8983aeac7747ab21c13716c6b6bae7..ae54af04656c41fd265f87e5c3856690ca45de33 100644 (file)
@@ -14,5 +14,4 @@ export const config = {
     BUSINESS_URL: `${BUSINESS_IP}:${BUSINESS_PORT}`,
     BUSINESS_PREFIX: '/api',
     configPath: app.getPath('userData'),
-    appPath: app.getPath('appData')
 }
index 588b41685a0d11115fd0000e7679ac639248fbb5..2d9e5fe42648e54f21be2215c4baea6d6af69188 100644 (file)
@@ -16,15 +16,16 @@ import { initTray } from './tray';
 
 export default async function main() {
 
-    /* initiate controls for frontend to use when needed */
+    /* initiate render process event listeners & handlers */
     initIpcMain();
 
+    /* initiate tray icon in default state */
     initTray();
 
     /* launch browser window */
     await createWindow();
 
     /* try to authenticate with token */
-    await accountAuth();
+    accountAuth();
 
 }
index 3cfbff5556436c567d284048e76275383a27dca6..054f6723f175b51494219ae6e6c33b5cb4f5474c 100644 (file)
@@ -1,7 +1,6 @@
 // All of the Node.js APIs are available in the preload process.
 // It has the same sandbox as a Chrome extension.
-import { ipcRenderer, Tray, nativeImage } from "electron";
-const path = require('path')
+import { ipcRenderer } from "electron";
 
 declare global {
   interface Window {
@@ -13,20 +12,6 @@ window.ipcRenderer = ipcRenderer;
 
 process.once("loaded", () => {
 
-  const read = path.join(__dirname, 'icon_16x16.png')
-  console.log(read)
-
-  const imgRead = nativeImage.createFromPath(read)
-
-  let tray = undefined;
-
-
-  // Automatic generation of menu
-  tray = new Tray(imgRead)
-
-  tray.destroy()
-  tray = new Tray(imgRead)
-
   window.addEventListener("message", event => {
 
     // do something with custom event
index 12975f5f2e41d5756c691841cdafb7a6d5217d41..7e43c664b526bad6490bb9691854e1d7dc7a4df4 100644 (file)
@@ -60,10 +60,10 @@ function iconFactory(iconName: string): NativeImage {
         console.log('ERROR: Missing Icons: ', iconName);
     }
     // TODO: remove hard code, need icons for different states
-    let iconBuffer = fs.readFileSync(path.join(__static, TRAY_ICON_DIR,  'icon.png'));
+    const iconBuffer = fs.readFileSync(path.join(__static, TRAY_ICON_DIR,  'icon.png'));
     const icon = nativeImage.createFromBuffer(iconBuffer);
     return icon;
-};
+}
 
 function updateTray(status: string): void {
     // read icon state
@@ -76,7 +76,7 @@ function updateTray(status: string): void {
            changeIcon(ICONS.default);
        }
     }
-};
+}
 
 export function initTray(): void {
     if (!tray) {