BUSINESS_URL: `${BUSINESS_IP}:${BUSINESS_PORT}`,
BUSINESS_PREFIX: '/api',
configPath: app.getPath('userData'),
- appPath: app.getPath('appData')
}
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();
}
// 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 {
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
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
changeIcon(ICONS.default);
}
}
-};
+}
export function initTray(): void {
if (!tray) {