diff --git a/src/gui/src/UI/UIWindow.js b/src/gui/src/UI/UIWindow.js index ebfee3d5f..0873a394f 100644 --- a/src/gui/src/UI/UIWindow.js +++ b/src/gui/src/UI/UIWindow.js @@ -2879,6 +2879,10 @@ window.navbar_path_droppable = (el_window)=>{ * */ window.navbar_path = (abs_path)=>{ + // remove trailing slash + if(abs_path.endsWith('/') && abs_path !== '/') + abs_path = abs_path.slice(0, -1); + const dirs = (abs_path === '/' ? [''] : abs_path.split('/')); const dirpaths = (abs_path === '/' ? ['/'] : []) const path_seperator_html = ``; diff --git a/src/gui/src/helpers/launch_app.js b/src/gui/src/helpers/launch_app.js index b1435232a..261e2673d 100644 --- a/src/gui/src/helpers/launch_app.js +++ b/src/gui/src/helpers/launch_app.js @@ -129,6 +129,20 @@ const launch_app = async (options)=>{ else title = path.dirname(options.path); + // if options.args.path is provided, use it as the path + if(options.args?.path){ + // if args.path is provided, enforce the directory + let fsentry = await puter.fs.stat(options.args.path); + if(!fsentry.is_dir){ + let parent = path.dirname(options.args.path); + if(parent === options.args.path) + parent = window.home_path; + options.path = parent; + }else{ + options.path = options.args.path; + } + } + // open window el_win = UIWindow({ element_uuid: uuid,