Merge branch 'main' into patch-1

This commit is contained in:
V 2023-08-04 20:31:10 +02:00 committed by GitHub
commit 5a90b692e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 17 additions and 7 deletions

View file

@ -23,7 +23,7 @@
"watch": "pnpm build --watch"
},
"dependencies": {
"arrpc": "github:OpenAsar/arrpc#bfcba7e3d6e6f7301a5699c4a1eb10c968e7b568"
"arrpc": "github:OpenAsar/arrpc#b47fd7d498e248955c843a7857dd26478b82190a"
},
"devDependencies": {
"@fal-works/esbuild-plugin-global-externals": "^2.1.2",

View file

@ -6,8 +6,8 @@ settings:
dependencies:
arrpc:
specifier: github:OpenAsar/arrpc#bfcba7e3d6e6f7301a5699c4a1eb10c968e7b568
version: github.com/OpenAsar/arrpc/bfcba7e3d6e6f7301a5699c4a1eb10c968e7b568
specifier: github:OpenAsar/arrpc#b47fd7d498e248955c843a7857dd26478b82190a
version: github.com/OpenAsar/arrpc/b47fd7d498e248955c843a7857dd26478b82190a
devDependencies:
'@fal-works/esbuild-plugin-global-externals':
@ -4356,8 +4356,8 @@ packages:
engines: {node: '>=10'}
dev: true
github.com/OpenAsar/arrpc/bfcba7e3d6e6f7301a5699c4a1eb10c968e7b568:
resolution: {tarball: https://codeload.github.com/OpenAsar/arrpc/tar.gz/bfcba7e3d6e6f7301a5699c4a1eb10c968e7b568}
github.com/OpenAsar/arrpc/b47fd7d498e248955c843a7857dd26478b82190a:
resolution: {tarball: https://codeload.github.com/OpenAsar/arrpc/tar.gz/b47fd7d498e248955c843a7857dd26478b82190a}
name: arrpc
version: 3.1.0
dependencies:

View file

@ -11,6 +11,7 @@ export const DATA_DIR = process.env.VENCORD_USER_DATA_DIR || join(app.getPath("u
export const VENCORD_SETTINGS_DIR = join(DATA_DIR, "settings");
export const VENCORD_QUICKCSS_FILE = join(VENCORD_SETTINGS_DIR, "quickCss.css");
export const VENCORD_SETTINGS_FILE = join(VENCORD_SETTINGS_DIR, "settings.json");
export const VENCORD_THEMES_DIR = join(DATA_DIR, "themes");
// needs to be inline require because of circular dependency
// as otherwise "DATA_DIR" (which is used by ./settings) will be uninitialised

View file

@ -5,7 +5,7 @@
*/
import { app, dialog, ipcMain, session, shell } from "electron";
import { existsSync, readFileSync, watch } from "fs";
import { existsSync, mkdirSync, readFileSync, watch } from "fs";
import { open, readFile } from "fs/promises";
import { release } from "os";
import { join } from "path";
@ -14,7 +14,7 @@ import { debounce } from "shared/utils/debounce";
import { IpcEvents } from "../shared/IpcEvents";
import { setBadgeCount } from "./appBadge";
import { autoStart } from "./autoStart";
import { VENCORD_FILES_DIR, VENCORD_QUICKCSS_FILE } from "./constants";
import { VENCORD_FILES_DIR, VENCORD_QUICKCSS_FILE, VENCORD_THEMES_DIR } from "./constants";
import { mainWin } from "./mainWindow";
import { Settings } from "./settings";
@ -122,3 +122,12 @@ open(VENCORD_QUICKCSS_FILE, "a+").then(fd => {
}, 50)
);
});
mkdirSync(VENCORD_THEMES_DIR, { recursive: true });
watch(
VENCORD_THEMES_DIR,
{ persistent: false },
debounce(() => {
mainWin?.webContents.postMessage("VencordThemeUpdate", void 0);
})
);