Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
pleroma-fe
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Pipirupirupirupipirupi
pleroma-fe
Commits
a1c50c3f
Commit
a1c50c3f
authored
Jun 21, 2019
by
Wyatt Benno
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix for #553
parent
752ee9d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
6 deletions
+7
-6
src/modules/statuses.js
src/modules/statuses.js
+7
-6
No files found.
src/modules/statuses.js
View file @
a1c50c3f
...
...
@@ -146,7 +146,8 @@ const removeStatusFromGlobalStorage = (state, status) => {
}
}
const
addNewStatuses
=
(
state
,
{
statuses
,
showImmediately
=
false
,
timeline
,
user
=
{},
noIdUpdate
=
false
,
userId
})
=>
{
const
addNewStatuses
=
(
state
,
{
statuses
,
showImmediately
=
false
,
timeline
,
user
=
{},
noIdUpdate
=
false
,
userId
,
isPinned
=
false
})
=>
{
// Sanity check
if
(
!
isArray
(
statuses
))
{
return
false
...
...
@@ -160,10 +161,10 @@ const addNewStatuses = (state, { statuses, showImmediately = false, timeline, us
const
newer
=
timeline
&&
(
maxNew
>
timelineObject
.
maxId
||
timelineObject
.
maxId
===
0
)
&&
statuses
.
length
>
0
const
older
=
timeline
&&
(
minNew
<
timelineObject
.
minId
||
timelineObject
.
minId
===
0
)
&&
statuses
.
length
>
0
if
(
!
noIdUpdate
&&
newer
)
{
if
(
!
noIdUpdate
&&
newer
&&
!
isPinned
)
{
timelineObject
.
maxId
=
maxNew
}
if
(
!
noIdUpdate
&&
older
)
{
if
(
!
noIdUpdate
&&
older
&&
!
isPinned
)
{
timelineObject
.
minId
=
minNew
}
...
...
@@ -504,8 +505,8 @@ export const mutations = {
const
statuses
=
{
state
:
defaultState
(),
actions
:
{
addNewStatuses
({
rootState
,
commit
},
{
statuses
,
showImmediately
=
false
,
timeline
=
false
,
noIdUpdate
=
false
,
userId
})
{
commit
(
'
addNewStatuses
'
,
{
statuses
,
showImmediately
,
timeline
,
noIdUpdate
,
user
:
rootState
.
users
.
currentUser
,
userId
})
addNewStatuses
({
rootState
,
commit
},
{
statuses
,
showImmediately
=
false
,
timeline
=
false
,
noIdUpdate
=
false
,
userId
,
isPinned
=
false
})
{
commit
(
'
addNewStatuses
'
,
{
statuses
,
showImmediately
,
timeline
,
noIdUpdate
,
user
:
rootState
.
users
.
currentUser
,
userId
,
isPinned
})
},
addNewNotifications
({
rootState
,
commit
,
dispatch
,
rootGetters
},
{
notifications
,
older
})
{
commit
(
'
addNewNotifications
'
,
{
visibleNotificationTypes
:
visibleNotificationTypes
(
rootState
),
dispatch
,
notifications
,
older
,
rootGetters
})
...
...
@@ -543,7 +544,7 @@ const statuses = {
},
fetchPinnedStatuses
({
rootState
,
dispatch
},
userId
)
{
rootState
.
api
.
backendInteractor
.
fetchPinnedStatuses
(
userId
)
.
then
(
statuses
=>
dispatch
(
'
addNewStatuses
'
,
{
statuses
,
timeline
:
'
user
'
,
userId
,
showImmediately
:
true
}))
.
then
(
statuses
=>
dispatch
(
'
addNewStatuses
'
,
{
statuses
,
timeline
:
'
user
'
,
userId
,
showImmediately
:
true
,
isPinned
:
true
}))
},
pinStatus
({
rootState
,
commit
},
statusId
)
{
return
rootState
.
api
.
backendInteractor
.
pinOwnStatus
(
statusId
)
...
...
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