Skip to content
Projects
Groups
Snippets
Help
Sign in / Register
Toggle navigation
Minds Mobile
Project overview
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
179
Merge Requests
16
Security & Compliance
Packages
Wiki
Snippets
Members
Collapse sidebar
Close sidebar
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Minds
Minds Mobile
Commits
2294518f
Commit
2294518f
authored
1 hour ago
by
Juan Manuel Solaro
Browse files
Options
Download
(fix) revert changes on groupsService and GroupsStore
parent
9d86db94
new-welcome-onboarding
1 merge request
!472
WIP: oboarding/welcome-screen
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
38 deletions
+10
-38
src/groups/GroupsService.js
View file @
2294518f
...
...
@@ -4,7 +4,6 @@ import { abort } from '../common/helpers/abortableFetch';
import
stores
from
'
../../AppStores
'
;
import
featuresService
from
'
../common/services/features.service
'
;
import
entitiesService
from
'
../common/services/entities.service
'
;
import
FeedsService
from
'
../common/services/feeds.service
'
;
/**
* Groups Service
...
...
@@ -15,20 +14,17 @@ class GroupsService {
* Load groups
*/
async
loadList
(
filter
,
offset
)
{
let
entities
=
''
;
if
(
filter
!==
'
suggested
'
)
{
let
endpoint
=
'
api/v1/groups/
'
+
filter
;
// abort previous call
abort
(
'
groups:list
'
);
let
endpoint
=
(
filter
===
'
suggested
'
)
?
'
api/v2/entities/suggested/groups
'
+
(
stores
.
hashtag
.
all
?
'
/all
'
:
''
)
:
'
api/v1/groups/
'
+
filter
;
const
data
=
await
api
.
get
(
endpoint
,
{
limit
:
12
,
offset
},
'
groups:list
'
)
// abort previous call
abort
(
'
groups:list
'
);
entities
=
data
.
groups
;
}
else
{
entities
=
this
.
loadSuggestedGroups
();
}
const
data
=
await
api
.
get
(
endpoint
,
{
limit
:
12
,
offset
},
'
groups:list
'
)
let
entities
=
(
filter
===
'
suggested
'
)
?
data
.
entities
:
data
.
groups
;
if
(
offset
&&
entities
)
{
entities
.
shift
();
...
...
@@ -40,30 +36,6 @@ class GroupsService {
};
}
async
loadSuggestedGroups
(
offset
)
{
const
hashtags
=
''
,
period
=
'
30d
'
,
all
=
''
,
query
=
''
,
nsfw
=
[],
feedsService
=
new
FeedsService
();
feedsService
.
setEndpoint
(
`api/v2/feeds/global/top/groups`
)
.
setLimit
(
12
)
.
setAsActivities
(
true
)
.
setParams
({
hashtags
,
period
,
all
,
query
,
nsfw
,
});
await
feedsService
.
fetchRemoteOrLocal
();
return
await
feedsService
.
getEntities
();
}
/**
* Load a single group
* @param {string} guid
...
...
This diff is collapsed.
src/groups/GroupsStore.js
View file @
2294518f
...
...
@@ -28,7 +28,7 @@ class GroupsStore {
/**
* Load list
*/
async
loadList
(
filter
=
this
.
filter
)
{
async
loadList
()
{
if
(
this
.
list
.
cantLoadMore
())
{
return
;
}
...
...
@@ -37,7 +37,7 @@ class GroupsStore {
this
.
list
.
setErrorLoading
(
false
);
try
{
const
data
=
await
groupsService
.
loadList
(
filter
,
this
.
list
.
offset
);
const
data
=
await
groupsService
.
loadList
(
this
.
filter
,
this
.
list
.
offset
);
data
.
entities
=
GroupModel
.
createMany
(
data
.
entities
);
this
.
list
.
setList
(
data
);
this
.
assignRowKeys
(
data
);
...
...
This diff is collapsed.
Please
register
or
sign in
to comment