Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Lemmy UI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Mirror
Lemmy UI
Commits
1dfdb977
Commit
1dfdb977
authored
4 years ago
by
Dessalines
Browse files
Options
Downloads
Patches
Plain Diff
Communities page sorts by monthly active users. Fixes #244
parent
2cde42a4
Branches
community_sort_top_monthly
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/shared/components/communities.tsx
+2
-8
2 additions, 8 deletions
src/shared/components/communities.tsx
with
2 additions
and
8 deletions
src/shared/components/communities.tsx
+
2
−
8
View file @
1dfdb977
...
...
@@ -65,9 +65,6 @@ export class Communities extends Component<any, CommunitiesState> {
// Only fetch the data if coming from another route
if
(
this
.
isoData
.
path
==
this
.
context
.
router
.
route
.
match
.
url
)
{
this
.
state
.
communities
=
this
.
isoData
.
routeData
[
0
].
communities
;
this
.
state
.
communities
.
sort
(
(
a
,
b
)
=>
b
.
counts
.
subscribers
-
a
.
counts
.
subscribers
);
this
.
state
.
loading
=
false
;
}
else
{
this
.
refetch
();
...
...
@@ -283,7 +280,7 @@ export class Communities extends Component<any, CommunitiesState> {
refetch
()
{
let
listCommunitiesForm
:
ListCommunities
=
{
type_
:
ListingType
.
All
,
sort
:
SortType
.
Top
All
,
sort
:
SortType
.
Top
Month
,
limit
:
communityLimit
,
page
:
this
.
state
.
page
,
auth
:
authField
(
false
),
...
...
@@ -299,7 +296,7 @@ export class Communities extends Component<any, CommunitiesState> {
let
page
=
pathSplit
[
3
]
?
Number
(
pathSplit
[
3
])
:
1
;
let
listCommunitiesForm
:
ListCommunities
=
{
type_
:
ListingType
.
All
,
sort
:
SortType
.
Top
All
,
sort
:
SortType
.
Top
Month
,
limit
:
communityLimit
,
page
,
};
...
...
@@ -317,9 +314,6 @@ export class Communities extends Component<any, CommunitiesState> {
}
else
if
(
op
==
UserOperation
.
ListCommunities
)
{
let
data
=
wsJsonToRes
<
ListCommunitiesResponse
>
(
msg
).
data
;
this
.
state
.
communities
=
data
.
communities
;
this
.
state
.
communities
.
sort
(
(
a
,
b
)
=>
b
.
counts
.
subscribers
-
a
.
counts
.
subscribers
);
this
.
state
.
loading
=
false
;
window
.
scrollTo
(
0
,
0
);
this
.
setState
(
this
.
state
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment