mirror of
				https://github.com/scm-manager/scm-manager.git
				synced 2025-10-31 10:35:56 +01:00 
			
		
		
		
	Extract common function 'stripEndingSlash'
This commit is contained in:
		| @@ -56,6 +56,7 @@ import SourceExtensions from "../sources/containers/SourceExtensions"; | ||||
| import { FileControlFactory, JumpToFileButton } from "@scm-manager/ui-components"; | ||||
| import TagsOverview from "../tags/container/TagsOverview"; | ||||
| import TagRoot from "../tags/container/TagRoot"; | ||||
| import { urls } from "@scm-manager/ui-components"; | ||||
|  | ||||
| type Props = RouteComponentProps & | ||||
|   WithTranslation & { | ||||
| @@ -84,15 +85,8 @@ class RepositoryRoot extends React.Component<Props> { | ||||
|     } | ||||
|   } | ||||
|  | ||||
|   stripEndingSlash = (url: string) => { | ||||
|     if (url.endsWith("/")) { | ||||
|       return url.substring(0, url.length - 1); | ||||
|     } | ||||
|     return url; | ||||
|   }; | ||||
|  | ||||
|   matchedUrl = () => { | ||||
|     return this.stripEndingSlash(this.props.match.url); | ||||
|     return urls.stripEndingSlash(this.props.match.url); | ||||
|   }; | ||||
|  | ||||
|   matchesBranches = (route: any) => { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user