edit history weirdness
This commit is contained in:
parent
fdc0f39187
commit
039870daf0
3 changed files with 5 additions and 19 deletions
|
|
@ -184,7 +184,10 @@ export const fetchStatusHistory = ({ id, credentials }) =>
|
||||||
return {
|
return {
|
||||||
...rest,
|
...rest,
|
||||||
data: [...data].reverse().map((item) => {
|
data: [...data].reverse().map((item) => {
|
||||||
item.originalStatus = status
|
// History data is missing a lot of stuff present in original
|
||||||
|
// but we're really only missing the id for the timeago, the
|
||||||
|
// rest seem to render just fine.
|
||||||
|
item.id = id
|
||||||
return parseStatus(item)
|
return parseStatus(item)
|
||||||
}),
|
}),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -174,20 +174,7 @@ export const BUTTONS = [
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
action({ status }) {
|
action({ status }) {
|
||||||
const originalStatus = { ...status }
|
useStatusHistoryStore().openModal(status.id)
|
||||||
const stripFieldsList = [
|
|
||||||
'attachments',
|
|
||||||
'created_at',
|
|
||||||
'emojis',
|
|
||||||
'text',
|
|
||||||
'raw_html',
|
|
||||||
'nsfw',
|
|
||||||
'poll',
|
|
||||||
'summary',
|
|
||||||
'summary_raw_html',
|
|
||||||
]
|
|
||||||
stripFieldsList.forEach((p) => delete originalStatus[p])
|
|
||||||
useStatusHistoryStore().openModal(originalStatus.id)
|
|
||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -342,10 +342,6 @@ export const parseStatus = (data) => {
|
||||||
output.favoritedBy = []
|
output.favoritedBy = []
|
||||||
output.rebloggedBy = []
|
output.rebloggedBy = []
|
||||||
|
|
||||||
if (Object.hasOwn(data, 'originalStatus')) {
|
|
||||||
Object.assign(output, data.originalStatus)
|
|
||||||
}
|
|
||||||
|
|
||||||
return output
|
return output
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue