mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-04-19 14:53:50 +02:00
fix: Cannot access 'tray' before initialization
This commit is contained in:
@@ -49,6 +49,10 @@ let isOverlayActive = false;
|
|||||||
let appIsQuitting = false;
|
let appIsQuitting = false;
|
||||||
const rootDir = app.getAppPath();
|
const rootDir = app.getAppPath();
|
||||||
|
|
||||||
|
let tray = null;
|
||||||
|
let trayIcon = null;
|
||||||
|
let trayIconNotify = null;
|
||||||
|
|
||||||
// Get launch arguments
|
// Get launch arguments
|
||||||
let appImagePath = process.env.APPIMAGE;
|
let appImagePath = process.env.APPIMAGE;
|
||||||
const args = process.argv.slice(1);
|
const args = process.argv.slice(1);
|
||||||
@@ -477,9 +481,7 @@ function writeOverlayFrame(imageBuffer) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
let tray = null;
|
|
||||||
let trayIcon = null;
|
|
||||||
let trayIconNotify = null;
|
|
||||||
function destroyTray() {
|
function destroyTray() {
|
||||||
if (tray) {
|
if (tray) {
|
||||||
tray.destroy();
|
tray.destroy();
|
||||||
@@ -545,7 +547,9 @@ function createTray() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function setTrayIconNotification(notify) {
|
function setTrayIconNotification(notify) {
|
||||||
tray.setImage(notify ? trayIconNotify : trayIcon);
|
if (tray) {
|
||||||
|
tray.setImage(notify ? trayIconNotify : trayIcon);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function installVRCX() {
|
async function installVRCX() {
|
||||||
|
|||||||
Reference in New Issue
Block a user