From ae08ed67f66e0c9d0aa59eb0632aea5819f6467e Mon Sep 17 00:00:00 2001 From: "Mr. Stallion" Date: Wed, 3 Feb 2021 19:57:58 -0600 Subject: [PATCH] Hide latest ad from character preview if it was posted more than 45 minutes ago --- chat/preview/CharacterPreview.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/chat/preview/CharacterPreview.vue b/chat/preview/CharacterPreview.vue index cd84ee9..a80ddbc 100644 --- a/chat/preview/CharacterPreview.vue +++ b/chat/preview/CharacterPreview.vue @@ -196,7 +196,11 @@ export default class CharacterPreview extends Vue { updateAdStatus(): void { const cache = core.cache.adCache.get(this.characterName!); - if ((!cache) || (cache.posts.length === 0)) { + if ( + (!cache) + || (cache.posts.length === 0) + || (Date.now() - cache.posts[cache.posts.length - 1].datePosted.getTime() > (45 * 60 * 1000)) + ) { this.latestAd = undefined; return; }