1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-08 14:07:01 +09:00

custom css

This commit is contained in:
Andrew Simachev 2024-01-10 14:50:11 +01:00
parent 12e60b92d0
commit 0e7f55cc27
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8
5 changed files with 28 additions and 3 deletions

View file

@ -1,5 +1,7 @@
const { app, shell, BrowserWindow } = require('electron');
const { is } = require('electron-util');
const fs = require('fs');
const path = require('path');
const keytar = require('keytar');
const { download } = require('electron-dl');
@ -19,6 +21,13 @@ class Api {
isPinChecked = false;
appOnLoad (win) {
const cssPath = path.join(Util.userPath(), 'custom.css');
let css = '';
if (fs.existsSync(cssPath)) {
css = fs.readFileSync(cssPath, 'utf8');
};
Util.send(win, 'init', {
dataPath: Util.dataPath(),
config: ConfigManager.config,
@ -29,6 +38,7 @@ class Api {
phrase: this.phrase,
isPinChecked: this.isPinChecked,
languages: win.webContents.session.availableSpellCheckerLanguages,
css: String(css || ''),
});
win.route = '';