Merge pull request #494 from ciderapp/themes-fix-linux

Fix linux themes
This commit is contained in:
vapormusic 2022-02-21 19:43:20 +07:00 committed by GitHub
commit c8f99d5ad7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 3 deletions

View file

@ -251,7 +251,7 @@ export class BrowserWindow {
}) })
app.get("/themes/:theme", (req, res) => { app.get("/themes/:theme", (req, res) => {
const theme = req.params.theme.toLowerCase(); const theme = req.params.theme;
const themePath = join(utils.getPath('srcPath'), "./renderer/themes/", theme); const themePath = join(utils.getPath('srcPath'), "./renderer/themes/", theme);
const userThemePath = join(utils.getPath('themes'), theme); const userThemePath = join(utils.getPath('themes'), theme);
if (existsSync(userThemePath)) { if (existsSync(userThemePath)) {
@ -264,7 +264,7 @@ export class BrowserWindow {
}); });
app.get("/themes/:theme/*", (req, res) => { app.get("/themes/:theme/*", (req, res) => {
const theme = req.params.theme.toLowerCase(); const theme = req.params.theme;
// @ts-ignore // @ts-ignore
const file = req.params[0]; const file = req.params[0];
const themePath = join(utils.getPath('srcPath'), "./renderer/themes/", theme); const themePath = join(utils.getPath('srcPath'), "./renderer/themes/", theme);
@ -283,6 +283,7 @@ export class BrowserWindow {
// @ts-ignore // @ts-ignore
const file = req.params[0]; const file = req.params[0];
const pluginPath = join(utils.getPath('plugins'), plugin); const pluginPath = join(utils.getPath('plugins'), plugin);
console.log(pluginPath)
if (existsSync(pluginPath)) { if (existsSync(pluginPath)) {
res.sendFile(join(pluginPath, file)); res.sendFile(join(pluginPath, file));
} else { } else {

View file

@ -5,7 +5,7 @@ import {utils} from './utils';
export class Plugins { export class Plugins {
private basePluginsPath = path.join(__dirname, '../plugins'); private basePluginsPath = path.join(__dirname, '../plugins');
private userPluginsPath = path.join(electron.app.getPath('userData'), 'plugins'); private userPluginsPath = path.join(electron.app.getPath('userData'), 'Plugins');
private readonly pluginsList: any = {}; private readonly pluginsList: any = {};
constructor() { constructor() {