fix: strip trailing slashes from server URL for consistency in config updates

This commit is contained in:
2025-06-19 22:04:53 +00:00
committed by GitHub
parent 77614fed97
commit fa5acd5a10
2 changed files with 16 additions and 3 deletions

View File

@@ -48,7 +48,12 @@ export const NavidromeConfigProvider: React.FC<NavidromeConfigProviderProps> = (
}, [config]);
const updateConfig = (newConfig: NavidromeConfig) => {
setConfig(newConfig);
// Strip trailing slashes from server URL for consistency
const cleanConfig = {
...newConfig,
serverUrl: newConfig.serverUrl.replace(/\/+$/, '')
};
setConfig(cleanConfig);
setIsConnected(false);
};