Hide latest ad from character preview if it was posted more than 45 minutes ago
This commit is contained in:
parent
c0bf309f6d
commit
ae08ed67f6
|
@ -196,7 +196,11 @@ export default class CharacterPreview extends Vue {
|
||||||
updateAdStatus(): void {
|
updateAdStatus(): void {
|
||||||
const cache = core.cache.adCache.get(this.characterName!);
|
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;
|
this.latestAd = undefined;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue