From 66e15a7dceb214b821a487812f33f8a02476ac5c Mon Sep 17 00:00:00 2001 From: thecodrr Date: Thu, 5 Aug 2021 23:16:10 +0500 Subject: [PATCH] fix(desktop): welcome note not loading properly --- apps/web/desktop/protocol.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/apps/web/desktop/protocol.js b/apps/web/desktop/protocol.js index baa4e509f..a45a0a0c6 100644 --- a/apps/web/desktop/protocol.js +++ b/apps/web/desktop/protocol.js @@ -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}/` };