mirror of
https://github.com/h3poteto/whalebird-desktop
synced 2025-01-27 07:46:15 +01:00
refs #30 Fix update toot when target toot is reblogged
This commit is contained in:
parent
ada91cca13
commit
629c8d8fb5
@ -51,12 +51,21 @@ const TimelineSpace = {
|
||||
state.homeTimeline = state.homeTimeline.map((toot) => {
|
||||
if (toot.id === message.id) {
|
||||
return message
|
||||
} else if (toot.reblog !== null && toot.reblog.id === message.id) {
|
||||
// When user reblog/favourite a reblogged toot, target message is a original toot.
|
||||
// So, a message which is received now is original toot.
|
||||
const reblog = {
|
||||
reblog: message
|
||||
}
|
||||
return Object.assign(toot, reblog)
|
||||
} else {
|
||||
return toot
|
||||
}
|
||||
})
|
||||
|
||||
state.notifications = state.notifications.map((notification) => {
|
||||
// I want to update toot only mention.
|
||||
// Because Toot component don't use status information when other patterns.
|
||||
if (notification.type === 'mention' && notification.status.id === message.id) {
|
||||
const status = {
|
||||
status: message
|
||||
|
@ -13,6 +13,13 @@ const Favourites = {
|
||||
state.favourites = state.favourites.map((toot) => {
|
||||
if (toot.id === message.id) {
|
||||
return message
|
||||
} else if (toot.reblog !== null && toot.reblog.id === message.id) {
|
||||
// When user reblog/favourite a reblogged toot, target message is a original toot.
|
||||
// So, a message which is received now is original toot.
|
||||
const reblog = {
|
||||
reblog: message
|
||||
}
|
||||
return Object.assign(toot, reblog)
|
||||
} else {
|
||||
return toot
|
||||
}
|
||||
|
@ -13,6 +13,13 @@ const Local = {
|
||||
state.timeline = state.timeline.map((toot) => {
|
||||
if (toot.id === message.id) {
|
||||
return message
|
||||
} else if (toot.reblog !== null && toot.reblog.id === message.id) {
|
||||
// When user reblog/favourite a reblogged toot, target message is a original toot.
|
||||
// So, a message which is received now is original toot.
|
||||
const reblog = {
|
||||
reblog: message
|
||||
}
|
||||
return Object.assign(toot, reblog)
|
||||
} else {
|
||||
return toot
|
||||
}
|
||||
|
@ -13,6 +13,13 @@ const Public = {
|
||||
state.timeline = state.timeline.map((toot) => {
|
||||
if (toot.id === message.id) {
|
||||
return message
|
||||
} else if (toot.reblog !== null && toot.reblog.id === message.id) {
|
||||
// When user reblog/favourite a reblogged toot, target message is a original toot.
|
||||
// So, a message which is received now is original toot.
|
||||
const reblog = {
|
||||
reblog: message
|
||||
}
|
||||
return Object.assign(toot, reblog)
|
||||
} else {
|
||||
return toot
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user