Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Commit

Permalink
Merge pull request #4188 from matrix-org/dbkr/remove_version_link
Browse files Browse the repository at this point in the history
Un-linkify version in settings
  • Loading branch information
dbkr authored Mar 9, 2020
2 parents d2cd64d + 650d3d0 commit b1ad0b8
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions src/components/views/settings/tabs/user/HelpUserSettingsTab.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,6 @@ import Modal from "../../../../../Modal";
import * as sdk from "../../../../../";
import PlatformPeg from "../../../../../PlatformPeg";

// Simple method to help prettify GH Release Tags and Commit Hashes.
const semVerRegex = /^v?(\d+\.\d+\.\d+(?:-rc.+)?)(?:-(?:\d+-g)?([0-9a-fA-F]+))?(?:-dirty)?$/i;
const ghVersionLabel = function(repo, token='') {
const match = token.match(semVerRegex);
let url;
if (match && match[1]) { // basic semVer string possibly with commit hash
url = (match.length > 1 && match[2])
? `https://github.com/${repo}/commit/${match[2]}`
: `https://github.com/${repo}/releases/tag/v${match[1]}`;
} else {
url = `https://github.com/${repo}/commit/${token.split('-')[0]}`;
}
return <a target="_blank" rel="noreferrer noopener" href={url}>{ token }</a>;
};

export default class HelpUserSettingsTab extends React.Component {
static propTypes = {
closeSettingsFn: PropTypes.func.isRequired,
Expand Down Expand Up @@ -184,9 +169,7 @@ export default class HelpUserSettingsTab extends React.Component {
);
}

const vectorVersion = this.state.vectorVersion
? ghVersionLabel('vector-im/riot-web', this.state.vectorVersion)
: 'unknown';
const vectorVersion = this.state.vectorVersion || 'unknown';

let olmVersion = MatrixClientPeg.get().olmVersion;
olmVersion = olmVersion ? `${olmVersion[0]}.${olmVersion[1]}.${olmVersion[2]}` : '<not-enabled>';
Expand Down

0 comments on commit b1ad0b8

Please sign in to comment.