#468 - clean up
This commit is contained in:
parent
5ab0e71500
commit
e6268c492e
2 changed files with 9 additions and 15 deletions
|
@ -362,7 +362,9 @@ const Status = {
|
||||||
this.$store.state.api.backendInteractor.pinOwnStatus(this.status.id).then((status) => {
|
this.$store.state.api.backendInteractor.pinOwnStatus(this.status.id).then((status) => {
|
||||||
if (status.error) {
|
if (status.error) {
|
||||||
this.error = status.error
|
this.error = status.error
|
||||||
setTimeout(() => this.error = null, 5000)
|
setTimeout(() => {
|
||||||
|
this.error = null
|
||||||
|
}, 5000)
|
||||||
} else {
|
} else {
|
||||||
this.$store.dispatch('updatePinned', status)
|
this.$store.dispatch('updatePinned', status)
|
||||||
}
|
}
|
||||||
|
|
|
@ -367,24 +367,16 @@ const addNewNotifications = (state, { dispatch, notifications, older, visibleNot
|
||||||
|
|
||||||
const removeStatus = (state, { timeline, userId, statusId }) => {
|
const removeStatus = (state, { timeline, userId, statusId }) => {
|
||||||
const timelineObject = state.timelines[timeline]
|
const timelineObject = state.timelines[timeline]
|
||||||
let removed = false
|
const status = userId ? { user: { id: userId } } : { id: statusId }
|
||||||
if (userId) {
|
remove(timelineObject.statuses, status)
|
||||||
remove(timelineObject.statuses, { user: { id: userId } })
|
remove(timelineObject.visibleStatuses, status)
|
||||||
remove(timelineObject.visibleStatuses, { user: { id: userId } })
|
if (statusId) {
|
||||||
removed = true
|
|
||||||
} else if (statusId) {
|
|
||||||
remove(timelineObject.statuses, { id: statusId })
|
|
||||||
remove(timelineObject.visibleStatuses, { id: statusId })
|
|
||||||
removed = true
|
|
||||||
delete timelineObject.statusesObject[statusId]
|
delete timelineObject.statusesObject[statusId]
|
||||||
delete timelineObject.visibleStatusesObject[statusId]
|
delete timelineObject.visibleStatusesObject[statusId]
|
||||||
sortTimeline(timelineObject)
|
sortTimeline(timelineObject)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (removed) {
|
|
||||||
timelineObject.minVisibleId = timelineObject.visibleStatuses.length > 0 ? last(timelineObject.visibleStatuses).id : 0
|
timelineObject.minVisibleId = timelineObject.visibleStatuses.length > 0 ? last(timelineObject.visibleStatuses).id : 0
|
||||||
timelineObject.maxId = timelineObject.statuses.length > 0 ? first(timelineObject.statuses).id : 0
|
timelineObject.maxId = timelineObject.statuses.length > 0 ? first(timelineObject.statuses).id : 0
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const mutations = {
|
export const mutations = {
|
||||||
|
|
Loading…
Reference in a new issue