diff --git a/src/components/card/CardSidebar.vue b/src/components/card/CardSidebar.vue index 94e1f92c6..de659ea75 100644 --- a/src/components/card/CardSidebar.vue +++ b/src/components/card/CardSidebar.vue @@ -261,8 +261,6 @@ export default { autosave: { enabled: false, uniqueId: 'unique' }, toolbar: false, }, - lastModifiedRelative: null, - lastCreatedRemative: null, descriptionSaveTimeout: null, descriptionSaving: false, hasActivity: capabilities && capabilities.activity, @@ -301,7 +299,7 @@ export default { return this.$store.getters.cardById(this.id) }, subtitle() { - return t('deck', 'Modified') + ': ' + this.lastModifiedRelative + ' ' + t('deck', 'Created') + ': ' + this.lastCreatedRemative + return t('deck', 'Modified') + ': ' + this.relativeDate(this.currentCard.lastModified * 1000) + ' ' + t('deck', 'Created') + ': ' + this.relativeDate(this.currentCard.createdAt * 1000) }, formatedAssignables() { return this.assignables.map(item => { @@ -348,12 +346,6 @@ export default { this.initialize() }, }, - created() { - setInterval(this.updateRelativeTimestamps, 10000) - }, - destroyed() { - clearInterval(this.updateRelativeTimestamps) - }, mounted() { this.initialize() }, @@ -381,7 +373,6 @@ export default { } this.desc = this.currentCard.description - this.updateRelativeTimestamps() }, showEditor() { if (!this.canEdit) { @@ -427,10 +418,6 @@ export default { this.$store.dispatch('updateCardDesc', this.copiedCard) } }, - updateRelativeTimestamps() { - this.lastModifiedRelative = OC.Util.relativeModifiedDate(this.currentCard.lastModified * 1000) - this.lastCreatedRemative = OC.Util.relativeModifiedDate(this.currentCard.createdAt * 1000) - }, setDue() { this.$store.dispatch('updateCardDue', this.copiedCard) }, diff --git a/src/store/card.js b/src/store/card.js index 561ac43fb..f6ee62273 100644 --- a/src/store/card.js +++ b/src/store/card.js @@ -147,6 +147,7 @@ export default { if (existingIndex !== -1) { Vue.set(state.cards[existingIndex], property, card[property]) } + Vue.set(state.cards[existingIndex], 'lastModified', Date.now() / 1000) }, cardIncreaseAttachmentCount(state, cardId) { const existingIndex = state.cards.findIndex(_card => _card.id === cardId)