fix(riot-mui): creation date from tag list was not updating on page change

This commit is contained in:
Joxit 2022-12-27 00:05:29 +01:00
parent d13f81c9af
commit 696aa39012
No known key found for this signature in database
GPG key ID: F526592B8E012263

View file

@ -20,6 +20,13 @@
import { dateFormat } from '../../scripts/utils';
export default {
onMounted(props) {
this.loadCreationDate(props);
},
onUpdated(props) {
this.loadCreationDate(props);
},
loadCreationDate(props) {
if (!props.image.creationDate && !props.image.ociImage) {
props.image.one('creation-date', (date) => {
this.update({
date: date,
@ -27,6 +34,7 @@
});
});
props.image.trigger('get-date');
}
},
getDate(image) {
return !image.ociImage ? `${dateFormat(image.creationDate)} ago` : 'Not Available';