TorrentGeneralInfo: drop leading and trailing whitespaces from comment (#674)

This commit is contained in:
Trim21
2023-10-18 06:17:42 +08:00
committed by GitHub
parent 711776484d
commit 1192e14294
2 changed files with 2 additions and 2 deletions
@@ -207,7 +207,7 @@ const TorrentGeneralInfo: FC = observer(() => {
<Trans id="torrents.details.general.comment" />
</td>
<td className="torrent-details__detail__value">
{torrent.comment ? <LinkedText text={torrent.comment} /> : VALUE_NOT_AVAILABLE}
{torrent.comment ? <LinkedText text={torrent.comment.trim()} /> : VALUE_NOT_AVAILABLE}
</td>
</tr>
<tr className="torrent-details__table__heading">
@@ -22,7 +22,7 @@ const torrentListMethodCallConfigs = {
methodCall: 'd.custom2=',
transformValue: (value: unknown): string => {
// ruTorrent sets VRS24mrkr as a comment prefix, so we use it as well for compatability
if (value === '' || typeof value !== 'string' || value.indexOf('VRS24mrker') !== 0) {
if (value === '' || typeof value !== 'string' || !value.startsWith('VRS24mrker')) {
return '';
}