Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
Minds Mobile
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
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor 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
Privacy statement
Keyboard shortcuts
?
What's new
6
Snippets
Groups
Projects
Show more breadcrumbs
Minds
Minds Mobile
Commits
360d7bf5
Commit
360d7bf5
authored
5 years ago
by
Martin Santangelo
Browse files
Options
Downloads
Patches
Plain Diff
(fix) last visited channel error
parent
70354547
Branches
feat/fix-visited-channel-error-tap
Branches containing commit
No related tags found
Tags containing commit
Loading
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/channel/ChannelStores.js
+15
-0
15 additions, 0 deletions
src/channel/ChannelStores.js
src/discovery/DiscoveryScreen.js
+1
-1
1 addition, 1 deletion
src/discovery/DiscoveryScreen.js
with
16 additions
and
1 deletion
src/channel/ChannelStores.js
+
15
−
0
View file @
360d7bf5
...
...
@@ -9,6 +9,7 @@ import wireService from '../wire/WireService';
import
ModelStorageList
from
'
../common/ModelStorageList
'
;
import
logService
from
'
../common/services/log.service
'
;
import
channelsService
from
'
../common/services/channels.service
'
;
import
UserModel
from
'
./UserModel
'
;
/**
* Channel Stores
...
...
@@ -49,12 +50,26 @@ class ChannelStores {
}
}
/**
* Add a visited channel to the list
* if the channel is already in the list it moves it to the top
* @param {UserModel} channel
*/
async
addVisited
(
channel
)
{
result
=
await
this
.
lastVisited
.
unshift
(
channel
);
// if it already exist we move it to the beggining
if
(
result
==
-
1
)
this
.
lastVisited
.
moveFirst
(
channel
.
guid
);
}
/**
* Get latest visited channels
* @param {number} count
*/
async
getVisited
(
count
)
{
const
result
=
await
this
.
lastVisited
.
first
(
count
);
return
UserModel
.
createMany
(
result
);
}
@
action
reset
()
{
this
.
lastVisited
.
clear
();
...
...
This diff is collapsed.
Click to expand it.
src/discovery/DiscoveryScreen.js
+
1
−
1
View file @
360d7bf5
...
...
@@ -446,7 +446,7 @@ export default class DiscoveryScreen extends Component {
* Show recently visited channel
*/
showLastChannels
=
async
()
=>
{
const
list
=
await
this
.
props
.
channel
.
las
tVisited
.
first
(
30
)
const
list
=
await
this
.
props
.
channel
.
ge
tVisited
(
30
)
// if (!list.length) return;
this
.
props
.
discovery
.
filters
.
setType
(
'
lastchannels
'
);
...
...
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