Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pleroma-fe
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
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
Ilja
pleroma-fe
Commits
49f7c84e
Commit
49f7c84e
authored
4 years ago
by
HJ
Browse files
Options
Downloads
Patches
Plain Diff
Fix pinned statuses and perhaps some other stuff
parent
fa2884a8
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/modules/users.js
+4
-2
4 additions, 2 deletions
src/modules/users.js
src/services/entity_normalizer/entity_normalizer.service.js
+9
-3
9 additions, 3 deletions
src/services/entity_normalizer/entity_normalizer.service.js
with
13 additions
and
5 deletions
src/modules/users.js
+
4
−
2
View file @
49f7c84e
...
...
@@ -137,11 +137,11 @@ export const mutations = {
},
saveFriendIds
(
state
,
{
id
,
friendIds
})
{
const
user
=
state
.
usersObject
[
id
]
user
.
friendIds
=
uniq
(
concat
(
user
.
friendIds
,
friendIds
))
user
.
friendIds
=
uniq
(
concat
(
user
.
friendIds
||
[]
,
friendIds
))
},
saveFollowerIds
(
state
,
{
id
,
followerIds
})
{
const
user
=
state
.
usersObject
[
id
]
user
.
followerIds
=
uniq
(
concat
(
user
.
followerIds
,
followerIds
))
user
.
followerIds
=
uniq
(
concat
(
user
.
followerIds
||
[]
,
followerIds
))
},
// Because frontend doesn't have a reason to keep these stuff in memory
// outside of viewing someones user profile.
...
...
@@ -202,7 +202,9 @@ export const mutations = {
},
setPinnedToUser
(
state
,
status
)
{
const
user
=
state
.
usersObject
[
status
.
user
.
id
]
user
.
pinnedStatusIds
=
user
.
pinnedStatusIds
||
[]
const
index
=
user
.
pinnedStatusIds
.
indexOf
(
status
.
id
)
if
(
status
.
pinned
&&
index
===
-
1
)
{
user
.
pinnedStatusIds
.
push
(
status
.
id
)
}
else
if
(
!
status
.
pinned
&&
index
!==
-
1
)
{
...
...
This diff is collapsed.
Click to expand it.
src/services/entity_normalizer/entity_normalizer.service.js
+
9
−
3
View file @
49f7c84e
...
...
@@ -2,6 +2,15 @@ import escape from 'escape-html'
import
parseLinkHeader
from
'
parse-link-header
'
import
{
isStatusNotification
}
from
'
../notification_utils/notification_utils.js
'
/** NOTICE! **
* Do not initialize UI-generated data here.
* It will override existing data.
*
* i.e. user.pinnedStatusIds was set to [] here
* UI code would update it with data but upon next user fetch
* it would be reverted back to []
*/
const
qvitterStatusType
=
(
status
)
=>
{
if
(
status
.
is_post_verb
)
{
return
'
status
'
...
...
@@ -173,9 +182,6 @@ export const parseUser = (data) => {
output
.
locked
=
data
.
locked
output
.
followers_count
=
data
.
followers_count
output
.
statuses_count
=
data
.
statuses_count
output
.
friendIds
=
[]
output
.
followerIds
=
[]
output
.
pinnedStatusIds
=
[]
if
(
data
.
pleroma
)
{
output
.
follow_request_count
=
data
.
pleroma
.
follow_request_count
...
...
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