fix(desktop): welcome note not loading properly

This commit is contained in:
thecodrr
2021-08-05 23:16:10 +05:00
parent 35c8d22e92
commit 66e15a7dce

View File

@@ -23,7 +23,7 @@ function registerProtocol() {
PROTOCOL,
async (request, callback) => {
const url = new URL(request.url);
if (url.hostname === HOSTNAME) {
if (shouldInterceptRequest(url)) {
logger.info("Intercepting request:", request);
const loadIndex = !path.extname(url.pathname);
@@ -81,4 +81,10 @@ function registerProtocol() {
);
}
const bypassedRoutes = ["/notes/index_v14.json", "/notes/welcome-web"];
function shouldInterceptRequest(url) {
let shouldIntercept = url.hostname === HOSTNAME;
return shouldIntercept && !bypassedRoutes.includes(url.pathname);
}
module.exports = { registerProtocol, URL: `${PROTOCOL}://${HOSTNAME}/` };