From d30d62f558ca5f8c74090900aa39c13ca3ca1d2e Mon Sep 17 00:00:00 2001 From: KernelDeimos Date: Thu, 21 Nov 2024 11:39:59 -0500 Subject: [PATCH] fix: share issue with prefix usernames --- src/gui/src/initgui.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gui/src/initgui.js b/src/gui/src/initgui.js index f37044d04..94eb5acfe 100644 --- a/src/gui/src/initgui.js +++ b/src/gui/src/initgui.js @@ -1477,7 +1477,11 @@ window.privacy_aware_path = function(fspath){ if(fspath.startsWith('~/')) return fspath; // e.g. /my_username/test.txt -> ~/test.txt - else if(fspath.startsWith(window.home_path)) + else if(fspath.startsWith( + window.home_path.endsWith('/') + ? window.home_path + : window.home_path + '/' + )) return fspath.replace(window.home_path, '~'); // e.g. /other_username/test.txt -> /other_username/test.txt else if(fspath.startsWith('/') && !fspath.startsWith(window.home_path)) @@ -1488,4 +1492,4 @@ window.privacy_aware_path = function(fspath){ // e.g. /username/path/to/item -> /username/path/to/item else return fspath; -} \ No newline at end of file +}; \ No newline at end of file