fix: share issue with prefix usernames

This commit is contained in:
KernelDeimos
2024-11-21 11:39:59 -05:00
parent d93fd419e4
commit d30d62f558
+6 -2
View File
@@ -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;
}
};