Skip to content
This repository has been archived by the owner on Dec 14, 2024. It is now read-only.

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Oct 12, 2023
2 parents 43b6105 + b4bdc76 commit ede8d70
Show file tree
Hide file tree
Showing 8 changed files with 5,366 additions and 5,351 deletions.
1 change: 0 additions & 1 deletion .idea/jsLibraryMappings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"games": [],
"background": "https://assets.adac.de/image/upload/ar_16:9,c_fill,f_auto,g_auto,q_auto:eco,w_2000/v1/ADAC-eV/KOR/Bilder/Archiv/PR/fuehrerschein-pruefung-theorie-2208_pmc0fd",
"backgroundColor": "#003049ff",
"textColor": "#eae2b7ff",
"accentColor": "#f77f00ff"
}
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "vtt-desktop-client",
"packageManager": "yarn@3.3.1",
"version": "1.3.10",
"version": "1.4.2",
"license": "MIT",
"description": "VTT Desktop Client",
"main": ".vite/build/main.js",
Expand Down Expand Up @@ -29,15 +29,15 @@
"@electron-forge/plugin-auto-unpack-natives": "^6.4.2",
"@electron-forge/plugin-local-electron": "^6.4.2",
"@electron-forge/plugin-vite": "^6.4.2",
"@types/node": "^20.6.2",
"@typescript-eslint/eslint-plugin": "^6.7.0",
"@typescript-eslint/parser": "^6.7.0",
"electron": "^26.2.4",
"@types/node": "^20.8.0",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"electron": "^25.9.1",
"electron-builder": "^24.6.4",
"eslint": "^8.49.0",
"eslint-plugin-import": "^2.25.0",
"ts-node": "^10.0.0",
"typescript": "~5.2.2"
"eslint": "^8.50.0",
"eslint-plugin-import": "^2.28.1",
"ts-node": "^10.9.1",
"typescript": "^5.2.2"
},
"scripts": {
"start": "electron-forge start",
Expand Down
7 changes: 0 additions & 7 deletions public/config.json

This file was deleted.

9 changes: 9 additions & 0 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,15 @@ ipcMain.handle("get-user-data", (_, gameId: GameId) => getLoginDetails(gameId))

ipcMain.handle("app-version", () => app.getVersion())

ipcMain.handle("app-config", () => {
try {
const json = fs.readFileSync(path.join(app.getAppPath(), "config.json")).toString();
return JSON.parse(json) as AppConfig;
} catch (e) {
return {} as AppConfig;
}
});

ipcMain.handle("select-path", (e) => {
windowsData[e.sender.id].autoLogin = true;
if (MAIN_WINDOW_VITE_DEV_SERVER_URL) {
Expand Down
4 changes: 4 additions & 0 deletions src/preload.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export type ContextBridgeApi = {
// request: RequestOnChannel;
userData: (gameId: string | number) => Promise<GameUserDataDecrypted>;
appVersion: () => Promise<string>;
appConfig: () => Promise<AppConfig>;
cachePath: () => Promise<string>;
setCachePath: (cachePath: string) => void;
returnToServerSelect: () => void;
Expand All @@ -50,6 +51,9 @@ const exposedApi: ContextBridgeApi = {
userData(gameId: string | number) {
return ipcRenderer.invoke("get-user-data", gameId) as Promise<GameUserDataDecrypted>;
},
appConfig() {
return ipcRenderer.invoke("app-config") as Promise<AppConfig>;
},
appVersion() {
return ipcRenderer.invoke("app-version") as Promise<string>;
},
Expand Down
4 changes: 1 addition & 3 deletions src/renderer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,7 @@ function applyAppConfig(config: AppConfig) {
async function createGameList() {
let config: AppConfig;
try {
config = await fetch("config.json").then((res) => {
return res.json();
}) as AppConfig;
config = await window.api.appConfig();
} catch (e) {
console.log("Failed to load config.json");
}
Expand Down
Loading

0 comments on commit ede8d70

Please sign in to comment.