recognise 1M celebration period

This commit is contained in:
Andrea Vos 2024-07-04 21:44:00 +02:00
parent c3ed7427c9
commit 5d94095dc4

View File

@ -21,6 +21,7 @@ interface Data {
flagName: string | null;
d: Day | null;
forceShowFlagDyn: boolean;
celebrate1M: boolean;
}
export default Vue.extend({
@ -35,9 +36,10 @@ export default Vue.extend({
flagName: null,
d: this.day,
forceShowFlagDyn: false,
celebrate1M: false,
};
},
mounted() {
async mounted() {
this.flagName = this.selectFlag();
this.$eventHub.$on('calendar-select', (d: Day | null) => {
this.forceShowFlagDyn = !!d;
@ -47,6 +49,13 @@ export default Vue.extend({
this.flagName = this.selectFlag();
}
});
const stats = await this.$axios.$get('/admin/stats-public');
if (stats && stats.overall.users >= 1_000_000 && stats.overall.users < 1_005_000) {
this.celebrate1M = true;
}
if (process.env.NODE_ENV == 'development' || process.env.NODE_ENV == 'test') {
this.celebrate1M = true;
}
},
methods: {
selectFlag(): string | null {