Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Dependency List
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
817
Issues
817
List
Boards
Labels
Service Desk
Milestones
Merge Requests
47
Merge Requests
47
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Commits
70032bca
Commit
70032bca
authored
2 hours ago
by
Mark Harding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fix): allow channel feeds to scroll past 150 entries
parent
2ab8e276
master
No related merge requests found
Pipeline
#72413343
passed with stages
in 27 minutes and 41 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
3 deletions
+22
-3
feeds.service.ts
src/app/common/services/feeds.service.ts
+16
-3
sorted.component.ts
src/app/modules/channels/sorted/sorted.component.ts
+6
-0
No files found.
src/app/common/services/feeds.service.ts
View file @
70032bca
...
...
@@ -39,6 +39,8 @@ export class FeedsService {
limit
:
BehaviorSubject
<
number
>
=
new
BehaviorSubject
(
12
);
offset
:
BehaviorSubject
<
number
>
=
new
BehaviorSubject
(
0
);
pageSize
:
Observable
<
number
>
;
pagingToken
:
string
=
''
;
canFetchMore
:
boolean
=
true
;
endpoint
:
string
=
''
;
params
:
any
=
{
sync
:
1
};
castToActivities
:
boolean
=
false
;
...
...
@@ -112,16 +114,26 @@ export class FeedsService {
}
fetch
():
FeedsService
{
this
.
inProgress
.
next
(
true
);
if
(
!
this
.
offset
.
getValue
())
this
.
inProgress
.
next
(
true
);
this
.
client
.
get
(
this
.
endpoint
,
{
...
this
.
params
,
...{
limit
:
150
,
// Over 12 scrolls
as_activities
:
this
.
castToActivities
?
1
:
0
,
from_timestamp
:
this
.
pagingToken
,
}})
.
then
((
response
:
any
)
=>
{
this
.
inProgress
.
next
(
false
);
this
.
rawFeed
.
next
(
response
.
entities
);
if
(
!
this
.
offset
.
getValue
())
this
.
inProgress
.
next
(
false
);
if
(
response
.
entities
.
length
)
{
this
.
rawFeed
.
next
(
this
.
rawFeed
.
getValue
().
concat
(
response
.
entities
));
this
.
pagingToken
=
response
[
'
load-next
'
];
}
else
{
this
.
canFetchMore
=
false
;
}
})
.
catch
(
err
=>
{
});
...
...
@@ -138,6 +150,7 @@ export class FeedsService {
clear
():
FeedsService
{
this
.
offset
.
next
(
0
);
this
.
pagingToken
=
''
;
this
.
rawFeed
.
next
([]);
return
this
;
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/channels/sorted/sorted.component.ts
View file @
70032bca
...
...
@@ -111,6 +111,12 @@ export class ChannelSortedComponent implements OnInit {
}
loadNext
()
{
if
(
this
.
feedsService
.
canFetchMore
&&
!
this
.
feedsService
.
inProgress
.
getValue
()
&&
this
.
feedsService
.
offset
.
getValue
()
)
{
this
.
feedsService
.
fetch
();
// load the next 150 in the background
}
this
.
feedsService
.
loadMore
();
}
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment