1
0
Fork 0
mirror of https://github.com/anyproto/anytype-ts.git synced 2025-06-08 05:57:02 +09:00

linter fixes

This commit is contained in:
Andrew Simachev 2023-08-10 11:12:43 +02:00
parent c1b1f26035
commit 0b6ed5bf4c
No known key found for this signature in database
GPG key ID: 49A163D0D14E6FD8
139 changed files with 917 additions and 898 deletions

View file

@ -21,6 +21,18 @@ const WindowManager = require('./electron/js/window.js');
const Server = require('./electron/js/server.js');
const Util = require('./electron/js/util.js');
const csp = [
"default-src 'self' 'unsafe-eval' blob: http://localhost:*",
"img-src 'self' http://*:* https://*:* data: blob: file://*",
"media-src 'self' http://*:* https://*:* data: blob: file://*",
"style-src 'unsafe-inline' http://localhost:* file://*",
"font-src data: file://* http://localhost:*",
"connect-src file://* http://localhost:* http://127.0.0.1:* ws://localhost:* https://*.anytype.io https://api.amplitude.com/ devtools://devtools data:",
"script-src-elem file: http://localhost:* https://sentry.io devtools://devtools 'unsafe-inline'",
"frame-src chrome-extension://react-developer-tools",
"worker-src 'self' 'unsafe-eval' blob: http://localhost:*",
];
app.commandLine.appendSwitch('ignore-connections-limit', 'localhost, 127.0.0.1');
app.removeAsDefaultProtocolClient(protocol);
@ -45,17 +57,6 @@ powerMonitor.on('resume', () => {
let deeplinkingUrl = '';
let waitLibraryPromise = null;
let mainWindow = null;
let csp = [
"default-src 'self' 'unsafe-eval' blob: http://localhost:*",
"img-src 'self' http://*:* https://*:* data: blob: file://*",
"media-src 'self' http://*:* https://*:* data: blob: file://*",
"style-src 'unsafe-inline' http://localhost:* file://*",
"font-src data: file://* http://localhost:*",
"connect-src file://* http://localhost:* http://127.0.0.1:* ws://localhost:* https://*.anytype.io https://api.amplitude.com/ devtools://devtools data:",
"script-src-elem file: http://localhost:* https://sentry.io devtools://devtools 'unsafe-inline'",
"frame-src chrome-extension://react-developer-tools",
"worker-src 'self' 'unsafe-eval' blob: http://localhost:*",
];
if (is.development && !port) {
console.error('ERROR: Please define SERVER_PORT env var');
@ -82,7 +83,7 @@ if (process.env.ANYTYPE_USE_SIDE_SERVER) {
};
function waitForLibraryAndCreateWindows () {
waitLibraryPromise.then((res) => {
waitLibraryPromise.then(() => {
global.serverAddress = Server.getAddress();
createWindow();
}, (err) => {
@ -154,13 +155,13 @@ app.on('ready', () => {
...details.responseHeaders,
'Content-Security-Policy': [ csp.join('; ') ]
}
})
});
});
ConfigManager.init(waitForLibraryAndCreateWindows);
});
app.on('second-instance', (event, argv, cwd) => {
app.on('second-instance', (event, argv) => {
Util.log('info', 'second-instance');
if (!is.macos) {