Skip to content

Commit 7a85599

Browse files
committed
better URL join logic in client
1 parent 130af56 commit 7a85599

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

Diff for: idom/client/app/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "idom-client-react",
33
"description": "A client for IDOM implemented in React",
4-
"version": "0.5.0",
4+
"version": "0.5.1",
55
"author": "Ryan Morshead",
66
"license": "MIT",
77
"repository": {

Diff for: idom/client/app/src/layout.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -194,11 +194,15 @@ function eventHandler(sendEvent, eventSpec) {
194194
};
195195
}
196196

197-
function useLazyModule(source, sourceUrl = "") {
197+
function useLazyModule(source, sourceUrlBase = "") {
198198
const [module, setModule] = react.useState(null);
199199
if (!module) {
200200
dynamicImport(
201-
source.startsWith("./") ? sourceUrl + source.slice(2) : source
201+
source.startsWith("./")
202+
? (sourceUrlBase.endsWith("/")
203+
? sourceUrlBase.slice(0, -1)
204+
: sourceUrlBase) + source.slice(1)
205+
: source
202206
).then(setModule);
203207
}
204208
return module;

0 commit comments

Comments
 (0)