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
826
Issues
826
List
Boards
Labels
Service Desk
Milestones
Merge Requests
70
Merge Requests
70
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Packages
Packages
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
9dc4d33a
Commit
9dc4d33a
authored
5 minutes ago
by
Mark Harding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fix): use combineLatest to ensure obversables are in sync for hasMore
parent
ce7d236f
refactor/es-feeds
1 merge request
!373
Refactor/es feeds
Pipeline
#67753368
running with stage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
4 deletions
+9
-4
feeds.service.ts
src/app/common/services/feeds.service.ts
+9
-4
No files found.
src/app/common/services/feeds.service.ts
View file @
9dc4d33a
...
...
@@ -12,7 +12,7 @@ import FeedsSync from '../../lib/minds-sync/services/FeedsSync.js';
import
hashCode
from
"../../helpers/hash-code"
;
import
AsyncStatus
from
"../../helpers/async-status"
;
import
{
BehaviorSubject
,
Observable
,
of
,
forkJoin
}
from
"rxjs"
;
import
{
BehaviorSubject
,
Observable
,
of
,
forkJoin
,
combineLatest
}
from
"rxjs"
;
import
{
take
,
switchMap
,
map
,
tap
}
from
"rxjs/operators"
;
export
type
FeedsServiceGetParameters
=
{
...
...
@@ -68,9 +68,14 @@ export class FeedsService {
}
}),
);
this
.
hasMore
=
this
.
rawFeed
.
pipe
(
map
(
feed
=>
{
return
this
.
inProgress
.
getValue
()
||
(
this
.
limit
.
getValue
()
+
this
.
offset
.
getValue
())
<
feed
.
length
;
this
.
hasMore
=
combineLatest
(
this
.
rawFeed
,
this
.
inProgress
,
this
.
limit
,
this
.
offset
).
pipe
(
map
(
values
=>
{
const
feed
=
values
[
0
];
const
inProgress
=
values
[
1
];
const
limit
=
values
[
2
];
const
offset
=
values
[
3
];
return
inProgress
?
true
:
(
limit
+
offset
)
<=
feed
.
length
;
}),
);
}
...
...
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