1
0
Files
AstralRinth/apps/app-frontend/src/components/ui/PromotionWrapper.vue
Geometrically a19ce0458a Finalize 0.8.1 release (#2182)
* Finalize 0.8.1 release

* Remove console.logs

* Fix build

* add default to users

* update release conf

* fix again?

* fix build (again)

* actually fix build

* Update config dir

* Update config dir

* Fix dir again
2024-08-20 17:53:14 -07:00

24 lines
655 B
Vue

<script setup lang="ts">
import { ref } from 'vue'
import { Promotion } from '@modrinth/ui'
import { get as getCreds } from '@/helpers/mr_auth.js'
import { handleError } from '@/store/notifications.js'
import { get_user } from '@/helpers/cache.js'
const showAd = ref(true)
const creds = await getCreds().catch(handleError)
if (creds && creds.user_id) {
const user = await get_user(creds.user_id).catch(handleError)
const MIDAS_BITFLAG = 1 << 0
if (user && (user.badges & MIDAS_BITFLAG) === MIDAS_BITFLAG) {
showAd.value = false
}
}
</script>
<template>
<Promotion v-if="showAd" :external="false" query-param="?r=launcher" />
</template>