fixing non-root path issues, #404

This commit is contained in:
zadam 2019-11-25 21:44:46 +01:00
parent 434d8ef48c
commit bf9ad976b9
5 changed files with 9 additions and 7 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -498,7 +498,7 @@
t._started = false;
onRenderStop();
} else {
setImmediate(step);
requestIdleCallback(step, { timeout: 10 });
}
}

2
package-lock.json generated
View file

@ -1,6 +1,6 @@
{
"name": "trilium",
"version": "0.37.3",
"version": "0.37.4",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View file

@ -127,11 +127,13 @@ async function consumeSyncData() {
}
function connectWebSocket() {
const protocol = document.location.protocol === 'https:' ? 'wss' : 'ws';
const loc = window.location;
const webSocketUri = (loc.protocol === "https:" ? "wss:" : "ws:")
+ "//" + loc.host + loc.pathname;
// use wss for secure messaging
const ws = new WebSocket(protocol + "://" + location.host);
ws.onopen = () => console.debug(utils.now(), "Connected to server with WebSocket");
const ws = new WebSocket(webSocketUri);
ws.onopen = () => console.debug(utils.now(), `Connected to server ${webSocketUri} with WebSocket`);
ws.onmessage = handleMessage;
// we're not handling ws.onclose here because reconnection is done in sendPing()