time calc all 10 secs

Signed-off-by: Jakob <jakob.roehrl@web.de>
This commit is contained in:
Jakob
2019-08-16 12:23:17 +02:00
parent 35e7c7dbe7
commit f63eef36b7

View File

@@ -99,6 +99,14 @@ export default {
desc: null desc: null
} }
}, },
created() {
setInterval(this.lastModifiedRelative, 10000)
setInterval(this.lastCreatedRemative, 10000)
},
destroyed() {
clearInterval(this.lastModifiedRelative)
clearInterval(this.lastCreatedRemative)
},
computed: { computed: {
...mapState({ ...mapState({
currentBoard: state => state.currentBoard, currentBoard: state => state.currentBoard,
@@ -108,10 +116,7 @@ export default {
return this.$store.getters.cardById(this.id) return this.$store.getters.cardById(this.id)
}, },
subtitle() { subtitle() {
let lastModified = OC.Util.relativeModifiedDate(this.currentCard.lastModified * 1000) return t('deck', 'Modified') + ': ' + this.lastModifiedRelative() + ' ' + t('deck', 'Created') + ': ' + this.lastCreatedRemative()
let createdAt = OC.Util.relativeModifiedDate(this.currentCard.createdAt * 1000)
return t('deck', 'Modified') + ': ' + lastModified + ' ' + t('deck', 'Created') + ': ' + createdAt
}, },
toolbarActions() { toolbarActions() {
return [ return [
@@ -133,7 +138,7 @@ export default {
} }
}, },
watch: { watch: {
'currentCard': { /* currentCard: {
immediate: true, immediate: true,
handler() { handler() {
this.copiedCard = JSON.parse(JSON.stringify(this.currentCard)) this.copiedCard = JSON.parse(JSON.stringify(this.currentCard))
@@ -141,13 +146,28 @@ export default {
this.assignedUsers = this.currentCard.assignedUsers.map((item) => item.participant) this.assignedUsers = this.currentCard.assignedUsers.map((item) => item.participant)
this.desc = this.currentCard.description this.desc = this.currentCard.description
} }
}, */
currentCard() {
this.copiedCard = JSON.parse(JSON.stringify(this.currentCard))
this.allLabels = this.currentCard.labels
this.assignedUsers = this.currentCard.assignedUsers.map((item) => item.participant)
this.desc = this.currentCard.description
console.log("change card" + this.desc)
}, },
desc() { desc() {
this.copiedCard.description = this.desc this.copiedCard.description = this.desc
this.saveDesc() this.saveDesc()
} }
}, },
methods: { methods: {
lastModifiedRelative() {
console.log(this.currentCard.lastModified)
return OC.Util.relativeModifiedDate(this.currentCard.lastModified * 1000)
},
lastCreatedRemative() {
return OC.Util.relativeModifiedDate(this.currentCard.createdAt * 1000)
},
setDue() { setDue() {
this.$store.dispatch('updateCardDue', this.copiedCard) this.$store.dispatch('updateCardDue', this.copiedCard)
}, },