Skip to content

Commit 5504a6f

Browse files
AmintaCCCPopenclaw
andauthored
fix: use pushed_at for update display and updated sorting (EvanLi#45)
Co-authored-by: openclaw <openclaw@users.noreply.github.com>
1 parent f07b9ca commit 5504a6f

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

src/components/RepositoryCard.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ export const RepositoryCard: React.FC<RepositoryCardProps> = ({
544544
<div className="flex items-center space-x-1">
545545
<Calendar className="w-4 h-4 flex-shrink-0" />
546546
<span className="truncate">
547-
{language === 'zh' ? '更新于' : 'Updated'} {formatDistanceToNow(new Date(repository.updated_at), { addSuffix: true })}
547+
{language === 'zh' ? '最近提交' : 'Last pushed'} {formatDistanceToNow(new Date(repository.pushed_at || repository.updated_at), { addSuffix: true })}
548548
</span>
549549
</div>
550550
</div>

src/components/SearchBar.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -246,8 +246,8 @@ export const SearchBar: React.FC = () => {
246246
bValue = b.stargazers_count;
247247
break;
248248
case 'updated':
249-
aValue = new Date(a.updated_at).getTime();
250-
bValue = new Date(b.updated_at).getTime();
249+
aValue = new Date(a.pushed_at || a.updated_at).getTime();
250+
bValue = new Date(b.pushed_at || b.updated_at).getTime();
251251
break;
252252
case 'name':
253253
aValue = a.name.toLowerCase();
@@ -258,8 +258,8 @@ export const SearchBar: React.FC = () => {
258258
bValue = b.starred_at ? new Date(b.starred_at).getTime() : 0;
259259
break;
260260
default:
261-
aValue = new Date(a.updated_at).getTime();
262-
bValue = new Date(b.updated_at).getTime();
261+
aValue = new Date(a.pushed_at || a.updated_at).getTime();
262+
bValue = new Date(b.pushed_at || b.updated_at).getTime();
263263
}
264264

265265
if (searchFilters.sortOrder === 'desc') {

src/components/SearchResultStats.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ export const SearchResultStats: React.FC<SearchResultStatsProps> = ({
3636
: 0,
3737
aiAnalyzed: filteredRepositories.filter(r => r.analyzed_at).length,
3838
recentlyUpdated: filteredRepositories.filter(r => {
39-
const updatedDate = new Date(r.updated_at);
39+
const updatedDate = new Date(r.pushed_at || r.updated_at);
4040
const thirtyDaysAgo = new Date();
4141
thirtyDaysAgo.setDate(thirtyDaysAgo.getDate() - 30);
4242
return updatedDate > thirtyDaysAgo;

0 commit comments

Comments
 (0)