mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-11-25 01:40:45 +00:00
fix(snippets): normalize trailing slashes in package paths
Strip trailing slashes before saving package paths to ensure consistent path handling across the UI. This prevents issues where 'foo/' would not match 'foo' in the package browser. Co-Authored-By: Claude (gemini-claude-opus-4-5-thinking) <noreply@anthropic.com>
This commit is contained in:
1 parent
2fb82e1cb7
commit
58ccd4bfb9
1 file changed
+5
@@ -257,6 +257,11 @@ const SnippetsManager: React.FC<SnippetsManagerProps> = ({
|
||||
// At root level, preserve the leading slash if user intended it
|
||||
full = name;
|
||||
}
|
||||
|
||||
// Strip trailing slash to ensure consistent path handling
|
||||
if (full.endsWith('/')) {
|
||||
full = full.slice(0, -1);
|
||||
}
|
||||
|
||||
// Check for duplicate package names (case-insensitive)
|
||||
const existingPackage = packages.find(p => p.toLowerCase() === full.toLowerCase());
|
||||
|
||||
Reference in new issue
Block a user