From 17aba769551618d130db2ec615ef01e2f6e5ac86 Mon Sep 17 00:00:00 2001 From: Michael Gartner Date: Sun, 1 Sep 2024 11:10:19 -0600 Subject: [PATCH] add url.host.includes('roamjs') to handleUrlFetch --- patches/roamjs-components+0.82.0.patch | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 patches/roamjs-components+0.82.0.patch diff --git a/patches/roamjs-components+0.82.0.patch b/patches/roamjs-components+0.82.0.patch new file mode 100644 index 0000000..ec5c77b --- /dev/null +++ b/patches/roamjs-components+0.82.0.patch @@ -0,0 +1,13 @@ +diff --git a/node_modules/roamjs-components/util/handleUrlFetch.js b/node_modules/roamjs-components/util/handleUrlFetch.js +index 3d3c377..c609e7e 100644 +--- a/node_modules/roamjs-components/util/handleUrlFetch.js ++++ b/node_modules/roamjs-components/util/handleUrlFetch.js +@@ -6,7 +6,7 @@ const handleFetch_1 = tslib_1.__importDefault(require("./handleFetch")); + const handleUrlFetch = (method) => (args, _data) => { + const _a = typeof args === "string" ? { path: args, data: _data } : args, { data = {} } = _a, fetchArgs = tslib_1.__rest(_a, ["data"]); + return (0, handleFetch_1.default)((url, init) => { +- if ((0, env_1.getNodeEnv)() === "development") { ++ if ((0, env_1.getNodeEnv)() === "development" && url.host.includes('roamjs')) { + url.searchParams.set("dev", "true"); + } + Object.entries(data).forEach(([k, v]) => url.searchParams.set(k, v));