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:
parent
12e60b92d0
commit
0e7f55cc27
5 changed files with 28 additions and 3 deletions
|
@ -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 = '';
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue