From 97d51a7763b14c92ee71ff9a012311dd9498d803 Mon Sep 17 00:00:00 2001 From: Vijay Raghavan Aravamudhan Date: Sun, 8 Aug 2021 00:01:37 +0000 Subject: refactor: path-references refactoring and using 'import' instead of 'require' (#1752) * refactor references to 'userData' and 'appData' directories to move hardcoding into single location * convert to es6 for lower memory usage as per https://codesource.io/the-difference-between-import-and-require-in-javascript/ --- src/lib/Tray.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib/Tray.js') diff --git a/src/lib/Tray.js b/src/lib/Tray.js index f37b4eb7b..f5970f7e7 100644 --- a/src/lib/Tray.js +++ b/src/lib/Tray.js @@ -1,7 +1,7 @@ import { app, Menu, nativeImage, nativeTheme, systemPreferences, Tray, ipcMain, } from 'electron'; -import path from 'path'; +import { join } from 'path'; import macosVersion from 'macos-version'; import { isMac, isWindows, isLinux } from '../environment'; @@ -174,7 +174,7 @@ export default class TrayIcon { platform = `${platform}-dark`; } - return nativeImage.createFromPath(path.join( + return nativeImage.createFromPath(join( __dirname, '..', 'assets', 'images', type, platform, `${asset}.${FILE_EXTENSION}`, )); } -- cgit v1.2.3-54-g00ecf