Skip to content

Commit

Permalink
Configure builder and change to yarn
Browse files Browse the repository at this point in the history
  • Loading branch information
jloh02 committed Jun 5, 2022
1 parent 7c4d1bc commit 57a2510
Show file tree
Hide file tree
Showing 8 changed files with 2,599 additions and 2,797 deletions.
10 changes: 8 additions & 2 deletions electron-builder.json5
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
productName: "VALORANT Chat Client",
publish: ["github"],
directories: {
buildResources: "build",
output: "release/${version}",
},
files: ["dist"],
win: {
target: ["nsis"],
icon: "assets/icon.png",
},
nsis: {
oneClick: false,
Expand All @@ -19,4 +18,11 @@
allowToChangeInstallationDirectory: true,
deleteAppDataOnUninstall: false,
},
extraResources: [
{
from: "node_modules/regedit/vbs",
to: "regedit/vbs",
filter: ["**/*"],
},
],
}
6 changes: 2 additions & 4 deletions packages/main/browser_window.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
import { SCREEN_DEFAULTS } from "./../constants";
import { join } from "path";
import { BrowserWindow, Tray, shell, globalShortcut, ipcMain } from "electron";
import { BrowserWindow, shell, globalShortcut, ipcMain } from "electron";
import log from "electron-log";
import { getPreference, saveWindowPreferences } from "./preferences";
import { startRiotClient } from "./windows";
import { closeNotifications, showNotification } from "./notifications";

let tray: Tray;

export function createWindow(isPackaged: boolean, prefFound?: boolean) {
let x: number | undefined;
let y: number | undefined;
Expand Down Expand Up @@ -136,7 +134,7 @@ export function createMainRendererWindow(
}
break;
case "OPEN_RIOT_CLIENT":
startRiotClient();
startRiotClient(isPackaged);
break;
default:
log.warn("[WINDOW] Invalid window control command: " + command);
Expand Down
2 changes: 1 addition & 1 deletion packages/main/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ app.on("activate", () => {
});

app.whenReady().then(() => {
startRiotClient();
startRiotClient(app.isPackaged);

const prefFound = readPreferences(app);
win = createMainRendererWindow(app.isPackaged, prefFound);
Expand Down
6 changes: 2 additions & 4 deletions packages/main/windows.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,8 @@ import log from "electron-log";
import child_process from "child_process";
import regedit, { RegistryItemCollection } from "regedit";

export async function startRiotClient() {
regedit.setExternalVBSLocation(
process.env.NODE_ENV === "production" ? "resources/regedit/vbs" : "vbs"
);
export async function startRiotClient(isPackaged: boolean) {
regedit.setExternalVBSLocation(isPackaged ? "resources/regedit/vbs" : "vbs");

const regPath = [
"HKCU\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\Riot Game valorant.live",
Expand Down
6 changes: 3 additions & 3 deletions packages/renderer/src/components/chat/Chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ onMounted(() => {
if (unreadTimeout) clearTimeout(unreadTimeout);
unreadTimeout = setTimeout(() => {
allowUnread.value = true;
}, 1000);
}, 1000) as unknown as number;
}
} else if (command === "FRIEND") updateFriends(data);
});
Expand All @@ -136,8 +136,8 @@ onMounted(() => {
updateMessages(messages, false);
chatMessagesView.value?.scrollLastMessage(false);
unreadTimeout = setTimeout(() => {
allowUnread.value = true;
}, 1000);
allowUnread.value = true;
}, 1000) as unknown as number;
});
});
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ function show(message: string) {
clearTimeout(timeout.value);
timeout.value = setTimeout(() => {
visibility.value = "no-show";
}, 2500);
}, 2500) as unknown as number;
}
defineExpose({ show });
Expand Down
Loading

0 comments on commit 57a2510

Please sign in to comment.