fix: history - handle path move between live and latest versions

pull/1634/head
NGPixel 5 years ago
parent 507928730a
commit 934842ab9b

@ -226,8 +226,7 @@ export default {
computed: {
darkMode: get('site/dark'),
fullTrail () {
return [
{
const liveTrailItem = {
versionId: 0,
authorId: this.authorId,
authorName: this.authorName,
@ -235,7 +234,17 @@ export default {
valueBefore: null,
valueAfter: null,
versionDate: this.updatedAt
},
}
// -> Check for move between latest and live
const prevPage = _.find(this.cache, ['versionId', _.get(this.trail, '[0].versionId', -1)])
if (prevPage && this.path !== prevPage.path) {
liveTrailItem.actionType = 'move'
liveTrailItem.valueBefore = prevPage.path
liveTrailItem.valueAfter = this.path
}
// -> Combine trail with live
return [
liveTrailItem,
...this.trail
]
},
@ -480,7 +489,7 @@ export default {
case 'edit':
return '' // 'mdi-pencil'
case 'move':
return 'forward'
return 'mdi-forward'
case 'initial':
return 'mdi-plus'
case 'live':

Loading…
Cancel
Save