1
0
mirror of https://github.com/git-touch/git-touch synced 2024-12-14 01:15:12 +01:00

fix: star and fork count 0 case

This commit is contained in:
Rongjian Zhang 2019-03-02 19:05:22 +08:00
parent c06179e109
commit ec1d995660

View File

@ -60,17 +60,20 @@ class _TrendingScreenState extends State<TrendingScreen> {
?.replaceAll(RegExp(r'</g-emoji>'), ''),
'stargazers': {
'totalCount': item.children[3]
.querySelectorAll('a')[0]
.querySelector('.octicon-star')
?.parent
?.innerHtml
?.replaceFirst(RegExp(r'^[\s\S]*svg>'), '')
?.trim()
},
'forks': {
'totalCount': item.children[3]
.querySelectorAll('a')[1]
?.innerHtml
?.replaceFirst(RegExp(r'^[\s\S]*svg>'), '')
?.trim(),
'totalCount': item
.querySelector('.octicon-repo-forked')
?.parent
?.innerHtml
?.replaceFirst(RegExp(r'^[\s\S]*svg>'), '')
?.trim() ??
0,
},
'primaryLanguage': lang,
'isPrivate': false,