Преглед изворни кода

Use join. to build target path

Nariman Jelveh пре 10 месеци
родитељ
комит
5d58764316
1 измењених фајлова са 3 додато и 8 уклоњено
  1. 3 8
      src/gui/src/helpers.js

+ 3 - 8
src/gui/src/helpers.js

@@ -878,22 +878,17 @@ window.available_templates = async () => {
                 ? ''
                 ? ''
                 : element.name.slice(extIndex + 1);
                 : element.name.slice(extIndex + 1);
 
 
-            console.log(extension)
             if(extension == "txt") extension = "text"
             if(extension == "txt") extension = "text"
             
             
-            // TODO: should use path join utility
-            const path =
-                baseRoute + "/" +
-                hasTemplateFolder.name + '/' +
-                element.name;
+            const _path = path.join( baseRoute, hasTemplateFolder.name, element.name);
 
 
+            console.log(_path)
             const itemStructure = {
             const itemStructure = {
-                path,
+                path: _path,
                 html: `${extension.toUpperCase()} ${name}`,
                 html: `${extension.toUpperCase()} ${name}`,
                 extension:extension,
                 extension:extension,
                 name: element.name
                 name: element.name
             }
             }
-            console.log(extension)
             result.push(itemStructure)
             result.push(itemStructure)
         });
         });