MaxMind IP database & region approvals
This commit is contained in:
38
src/components/ApproveRegion.vue
Normal file
38
src/components/ApproveRegion.vue
Normal file
@@ -0,0 +1,38 @@
|
||||
<template>
|
||||
<slot v-if="s.regionApproved"/>
|
||||
<v-card v-if="s.regionApproved===null" title="Loading..." prepend-icon="mdi-clock-outline"
|
||||
text="If loading takes more than a second, please refresh your browser or contact support@dexorder.trade"/>
|
||||
<v-card v-if="s.regionApproved===false" title="Restricted" prepend-icon="mdi-alert"
|
||||
text="Dexorder is not available in your region."/>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
import {useStore} from "@/store/store";
|
||||
import {socket} from "@/socket.js";
|
||||
import {useRoute} from "vue-router";
|
||||
|
||||
const s = useStore()
|
||||
|
||||
let timer = null
|
||||
|
||||
const bypass = useRoute().query.approval
|
||||
|
||||
function tryApproval() {
|
||||
console.log('approval query', bypass)
|
||||
if (timer!==null) {
|
||||
clearTimeout(timer)
|
||||
timer = null
|
||||
}
|
||||
if (s.regionApproved===null) {
|
||||
socket.emit('approveRegion', bypass)
|
||||
timer = setTimeout(tryApproval, 1000)
|
||||
}
|
||||
}
|
||||
|
||||
tryApproval()
|
||||
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
|
||||
</style>
|
||||
Reference in New Issue
Block a user