restore the status history item
This commit is contained in:
parent
0190a698db
commit
32839357f5
1 changed files with 30 additions and 0 deletions
|
|
@ -1,5 +1,7 @@
|
|||
import { useEditStatusStore } from 'src/stores/editStatus.js'
|
||||
import { useReportsStore } from 'src/stores/reports.js'
|
||||
import { useStatusHistoryStore } from 'src/stores/statusHistory.js'
|
||||
|
||||
const PRIVATE_SCOPES = new Set(['private', 'direct'])
|
||||
const PUBLIC_SCOPES = new Set(['public', 'unlisted'])
|
||||
export const BUTTONS = [{
|
||||
|
|
@ -139,6 +141,34 @@ export const BUTTONS = [{
|
|||
return dispatch('bookmark', { id: status.id })
|
||||
}
|
||||
}
|
||||
}, {
|
||||
// =========
|
||||
// EDIT HISTORY
|
||||
// =========
|
||||
name: 'editHistory',
|
||||
icon: 'history',
|
||||
label: 'status.status_history',
|
||||
if ({ status, state }) {
|
||||
return state.instance.editingAvailable &&
|
||||
status.edited_at !== null
|
||||
},
|
||||
action ({ status }) {
|
||||
const originalStatus = { ...status }
|
||||
const stripFieldsList = [
|
||||
'attachments',
|
||||
'created_at',
|
||||
'emojis',
|
||||
'text',
|
||||
'raw_html',
|
||||
'nsfw',
|
||||
'poll',
|
||||
'summary',
|
||||
'summary_raw_html'
|
||||
]
|
||||
stripFieldsList.forEach(p => delete originalStatus[p])
|
||||
useStatusHistoryStore().openStatusHistoryModal(originalStatus)
|
||||
return Promise.resolve()
|
||||
}
|
||||
}, {
|
||||
// =========
|
||||
// EDIT
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue