<script setup>
  import { onBeforeUnmount, onMounted } from 'vue'
  import { resetLocalServiceCheck } from './utils/request'
  import { disableBackButton } from './utils/backButtonHandler'

  let cleanup = null

  onMounted(() => {
    cleanup = disableBackButton()
  })

  onBeforeUnmount(() => {
    resetLocalServiceCheck()
    if (cleanup) {
      cleanup()
    }
  })
</script>

<template>
  <router-view></router-view>
</template>

<style lang="scss">
  .van-toast--text {
    background: rgba(0, 0, 0, 0.7) !important;
  }
  .loading-toast {
    background: rgba(0, 0, 0, 0.7) !important;
  }
  .confirm-dialog {
    .van-dialog__message {
      font-size: 18px;
    }
  }

  .animate__animated.animate__fadeInRight,
  .animate__animated.animate__fadeOutRight {
    --animate-duration: 500ms;
  }
</style>
