You've already forked AstralRinth
forked from didirus/AstralRinth
* 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
24 lines
655 B
Vue
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>
|