mirror of
https://github.com/zadam/trilium.git
synced 2025-11-12 00:05:50 +01:00
tabs WIP
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import utils from './utils.js';
|
||||
import infoService from "./info.js";
|
||||
|
||||
const REQUEST_LOGGING_ENABLED = false;
|
||||
|
||||
function getHeaders() {
|
||||
// headers need to be lowercase because node.js automatically converts them to lower case
|
||||
// so hypothetical protectedSessionId becomes protectedsessionid on the backend
|
||||
@@ -45,7 +47,9 @@ async function call(method, url, data) {
|
||||
return new Promise((resolve, reject) => {
|
||||
reqResolves[requestId] = resolve;
|
||||
|
||||
console.log(utils.now(), "Request #" + requestId + " to " + method + " " + url);
|
||||
if (REQUEST_LOGGING_ENABLED) {
|
||||
console.log(utils.now(), "Request #" + requestId + " to " + method + " " + url);
|
||||
}
|
||||
|
||||
ipc.send('server-request', {
|
||||
requestId: requestId,
|
||||
@@ -89,7 +93,9 @@ if (utils.isElectron()) {
|
||||
const ipc = require('electron').ipcRenderer;
|
||||
|
||||
ipc.on('server-response', (event, arg) => {
|
||||
console.log(utils.now(), "Response #" + arg.requestId + ": " + arg.statusCode);
|
||||
if (REQUEST_LOGGING_ENABLED) {
|
||||
console.log(utils.now(), "Response #" + arg.requestId + ": " + arg.statusCode);
|
||||
}
|
||||
|
||||
reqResolves[arg.requestId](arg.body);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user