« get me outta code hell

hsmusic-wiki - HSMusic - static wiki software cataloguing collaborative creation
about summary refs log tree commit diff
path: root/src/urls.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/urls.js')
-rw-r--r--src/urls.js14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/urls.js b/src/urls.js
index 5e334c1e..b51ea459 100644
--- a/src/urls.js
+++ b/src/urls.js
@@ -129,6 +129,9 @@ export function generateURLs(urlSpec) {
         if (template === null) {
           // Self-diagnose, brutally.
 
+          // TODO: This variable isn't used, and has never been used,
+          // but it might have been *meant* to be used?
+          // eslint-disable-next-line no-unused-vars
           const otherTemplateKey = (device ? 'posix' : 'device');
 
           const {value: {[templateKey]: otherTemplate}} =
@@ -283,9 +286,14 @@ export function getURLsFrom({
       to = targetFullKey;
     }
 
-    return (
-      subdirectoryPrefix +
-      urls.from(from).to(to, ...args));
+    const toResult =
+      urls.from(from).to(to, ...args);
+
+    if (getOrigin(toResult)) {
+      return toResult;
+    } else {
+      return subdirectoryPrefix + toResult;
+    }
   };
 }